callableStatment.execute() throwing NullPointerException from JDBC [message #144815] |
Fri, 28 October 2005 08:31 |
saradhi1014
Messages: 1 Registered: October 2005
|
Junior Member |
|
|
Hi,
I am experiencing with this exception while calling the stored procedure using callableStatement.execute().
The stored procedure is working on Oracle with other applications(non java).
The platform for this application is Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production
OS: Windows XP, JDK 5.0, Tomcat 5.5.9,
Tested with JDBC driver classes : ojdbc14_g.jar/14.jar classes12.jar/12_g.jar
I appriciate your help.
here is the java code ....
Connection conn = JDBCConnect.getConnection();
String spCall = " {call AcctProfile(?,?,?,?,?,?,?)}";
CallableStatement calStmt = conn.prepareCall(spCall);
calStmt.setString(1, accountNumber);
calStmt.setString(2, lastName);
calStmt.setString(3, firstName);
calStmt.setString(4, PhNum);
calStmt.registerOutParameter(5, OracleTypes.CURSOR);
calStmt.registerOutParameter(6, OracleTypes.VARCHAR);
calStmt.registerOutParameter(7, OracleTypes.VARCHAR);
log.debug("I am about to executing the Stored Prodcedure");
try
{
calStmt.execute(); // ######### throws Null pointer exception
SQLWarning warn = conn.getWarnings();
warn.printStackTrace();
} catch (SQLException sqle)
{
log.error(sqle);
SQLWarning warn = conn.getWarnings();
warn.printStackTrace();
}
ResultSet rSet = (ResultSet) calStmt.getObject(5);
log.debug(calStmt.getString(6) == null ? "executed the statement": calStmt.getString(6));
log.debug(calStmt.getString(7) == null ? "executed the statement": calStmt.getString(7));
java.lang.NullPointerException
at oracle.jdbc.ttc7.TTCAdapter.newTTCType(TTCAdapter.java:300)
at oracle.jdbc.ttc7.TTCAdapter.createNonPlsqlTTCColumnArray(TTCAdapter.java:272)
at oracle.jdbc.ttc7.TTCAdapter.createNonPlsqlTTCDataSet(TTCAdapter.java:232)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1846)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:656)
at TestSP.AccountProfileSP.testSP(Unknown Source)
at com.test.MasterController.processRequest(Unknown Source)
at com.test.MasterController.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
|
|
|