Home » Developer & Programmer » JDeveloper, Java & XML » Callable Statement (urgent please help me)
Callable Statement (urgent please help me) [message #92782] Sun, 16 January 2005 23:00 Go to next message
Konda Reddy T
Messages: 1
Registered: January 2005
Junior Member
Hi
I am using the folowing code to exceute the Callabale Statement. We are using the Weblogic 8.1 server

import javax.naming.InitialContext;
import javax.naming.Context;
import java.util.*;
import javax.sql.DataSource;
import javax.rmi.PortableRemoteObject;
import java.sql.*;

class Test{
public static void main(String a[[]]) throws Exception{

Properties prop=new Properties();
prop.put(Context.PROVIDER_URL,"t3://localhost:7001");
prop.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
InitialContext ctx =new InitialContext(prop);
//InitialContext ctx =new InitialContext();

System.out.println ("created initial context");
DataSource ds = (DataSource)ctx.lookup("svcDataSource");
System.out.println ("looked up svcDataSource");
Connection con = ds.getConnection();

String procName="p_dl_ems_extract_id";

CallableStatement cs = null;

try{
cs=con.prepareCall("? = {call " + procName + "(?)}");

System.out.println ("Procedure Name"+procName);

cs.registerOutParameter(1,Types.NUMERIC);
cs.setInt(2,19804);
cs.executeUpdate();

if(cs.getInt(1) > 0)
{
System.out.println("Return Value"+cs.getInt(1));
}

}catch(SQLException excp) {
excp.printStackTrace();
} finally{
cs.close();
}
}
}

It is giving me the follwing message:

<Jan 17, 2005 1:19:38 PM IST> <Warning> <RMI> <BEA-080003> <RuntimeException thr
own by rmi server: weblogic.jdbc.rmi.internal.CallableStatementImpl_weblogic_jdb
c_wrapper_CallableStatement_oracle_jdbc_driver_OracleCallableStatement.executeUp
date()
java.lang.NullPointerException.
java.lang.NullPointerException
at oracle.jdbc.ttc7.TTCAdapter.newTTCType(TTCAdapter.java:300)
at oracle.jdbc.ttc7.TTCAdapter.createNonPlsqlTTCColumnArray(TTCAdapter.j
ava:270)
at oracle.jdbc.ttc7.TTCAdapter.createNonPlsqlTTCDataSet(TTCAdapter.java:
231)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1934)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:114
1)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.ja
va:2149)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.jav
a:2032)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:2894)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
edStatement.java:608)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStateme
nt.java:94)
at weblogic.jdbc.rmi.internal.CallableStatementImpl_weblogic_jdbc_wrappe
r_CallableStatement_oracle_jdbc_driver_OracleCallableStatement.executeUpdate(Unk
nown Source)
at weblogic.jdbc.rmi.internal.CallableStatementImpl_weblogic_jdbc_wrappe
r_CallableStatement_oracle_jdbc_driver_OracleCallableStatement_WLSkel.invoke(Unk
nown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:353)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
144)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:415)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>
[[ConnectionImpl]] : Detected Connection Leak!!!!! : java.lang.Throwable: [[Null ex
ception passed, creating stack trace for offending caller]]
at weblogic.utils.StackTraceUtils.throwable2StackTrace(StackTraceUtils.j
ava:28)
at weblogic.jdbc.rmi.internal.ConnectionImpl.peerGone(ConnectionImpl.jav
a:104)
at weblogic.rjvm.RJVMImpl$PeerGoneDeliverer.execute(RJVMImpl.java:1394)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

<Jan 17, 2005 1:24:23 PM IST> <Info> <HTTP> <BEA-101047> <[[ServletContext(id=509
9540,name=console,context-path=/console)]] FileServlet: init>
<Jan 17, 2005 1:24:23 PM IST> <Info> <HTTP> <BEA-101047> <[[ServletContext(id=509
9540,name=console,context-path=/console)]] FileServlet: Using standard I/O>
<Jan 17, 2005 1:24:27 PM IST> <Info> <HTTP> <BEA-101047> <[[ServletContext(id=509
9540,name=console,context-path=/console)]] actions: init>
<Jan 17, 2005 2:24:44 PM IST> <Warning> <RMI> <BEA-080003> <RuntimeException thr
own by rmi server: weblogic.jdbc.rmi.internal.CallableStatementImpl_weblogic_jdb
c_wrapper_CallableStatement_oracle_jdbc_driver_OracleCallableStatement.executeUp
date()
java.lang.NullPointerException.
java.lang.NullPointerException
at oracle.jdbc.ttc7.TTCAdapter.newTTCType(TTCAdapter.java:300)
at oracle.jdbc.ttc7.TTCAdapter.createNonPlsqlTTCColumnArray(TTCAdapter.j
ava:270)
at oracle.jdbc.ttc7.TTCAdapter.createNonPlsqlTTCDataSet(TTCAdapter.java:
231)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1934)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:114
1)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.ja
va:2149)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.jav
a:2032)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:2894)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
edStatement.java:608)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStateme
nt.java:94)
at weblogic.jdbc.rmi.internal.CallableStatementImpl_weblogic_jdbc_wrappe
r_CallableStatement_oracle_jdbc_driver_OracleCallableStatement.executeUpdate(Unk
nown Source)
at weblogic.jdbc.rmi.internal.CallableStatementImpl_weblogic_jdbc_wrappe
r_CallableStatement_oracle_jdbc_driver_OracleCallableStatement_WLSkel.invoke(Unk
nown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:353)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
144)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:415)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>
[[ConnectionImpl]] : Detected Connection Leak!!!!! : java.lang.Throwable: [[Null ex
ception passed, creating stack trace for offending caller]]
at weblogic.utils.StackTraceUtils.throwable2StackTrace(StackTraceUtils.j
ava:28)
at weblogic.jdbc.rmi.internal.ConnectionImpl.peerGone(ConnectionImpl.jav
a:104)
at weblogic.rjvm.RJVMImpl$PeerGoneDeliverer.execute(RJVMImpl.java:1394)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Re: Callable Statement (urgent please help me) [message #109012 is a reply to message #92782] Mon, 21 February 2005 02:46 Go to previous message
Khyati Rana
Messages: 1
Registered: February 2005
Junior Member
Hi,
We are facing the same problem, with WLS 8.1
Did you get the solution for it?

The following is the stacktrace in case...
java.sql.SQLException: ORA-00900: invalid SQL statement

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1983)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1141)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2149)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2032)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2894)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:608)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:684)
at weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:68)
at app.zycus.sdm.projectconfiguration.session.ProjectConfigurationLocalBean.dropProjectTables(ProjectConfigurationLocalBean.java:1137)
at app.zycus.sdm.projectconfiguration.session.ProjectConfigurationLocalBean.projectConfigurationBySuperAdmin(ProjectConfigurationLocalBean.java:184)
at app.zycus.sdm.projectconfiguration.session.ProjectConfigurationLocalBean_4ry08w_ELOImpl.projectConfigurationBySuperAdmin(ProjectConfigurationLocalBean_4ry08w_ELOImpl.java:46)
at app.zycus.sdm.projectconfiguration.session.ProjectConfigurationFacadeBean.projectConfigurationBySuperAdmin(ProjectConfigurationFacadeBean.java:73)
at app.zycus.sdm.projectconfiguration.session.ProjectConfigurationFacadeBean_d71ktu_EOImpl.projectConfigurationBySuperAdmin(ProjectConfigurationFacadeBean_d71ktu_EOImpl.java:46)
at app.zycus.sdm.projectconfiguration.session.ProjectConfigurationFacadeBean_d71ktu_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:166)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
Previous Topic: procedure
Next Topic: File handling using java stored procedures
Goto Forum:
  


Current Time: Mon Nov 25 19:04:35 CST 2024