File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Calling Oracle functions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Calling Oracle functions" Watch "Calling Oracle functions" New topic
Author

Calling Oracle functions

Hendrik Coetzee
Greenhorn

Joined: Nov 12, 2004
Posts: 1
Hi

Having a bit of trouble when calling an Oracle function. In the code below, as soon as I call the execute() function, I get the exception. I don't get it with stored procedured that don't return values, but as soon as a stored procedure or function returns a resultset (or value) this exception is thrown. This is using the latest ojdbc14.jar drivers on an 8i database.

Would greatly appreciate any ideas / thoughts.

Thank you



Exception:
Exception in thread "main" java.lang.NullPointerException
at oracle.jdbc.driver.T4C8Oall.getNumRows(T4C8Oall.java:728)
at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(T4CCallableStatement.java:787)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1028)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:2979)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4103)
at com.ccoster.beans.DBConn.execFunction(DBConn.java:484)
at OSDXMLPublish.runCIFEngine(OSDXMLPublish.java:328)
at OSDXMLPublish.start(OSDXMLPublish.java:284)
at OSDXMLPublish.main(OSDXMLPublish.java:84)
nilesh Katakkar
Ranch Hand

Joined: Oct 27, 2004
Posts: 35
Whats the Java version you are using ?

ojdbc14.jar is used with Java 1.4.x ? For older versions you will still need to go to classes12.jar


nilesh<br />neilindallas@hotmail.com
nilesh Katakkar
Ranch Hand

Joined: Oct 27, 2004
Posts: 35
Also

String funct = "{ ? = ci_publish_client_data(?) }";

Should be

String funct = "{ call ? = ci_publish_client_data(?) }";
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling Oracle functions
 
Similar Threads
EL function
Error when calling stored function using xml table in oracle
Can I use a Clob as an attribute of a structured type (to map to a Java VO)?
Error while callling stored procedure : Non supported SQL92 token
Calling a function vs a procedure on Oracle with CallableStatement