wood burning stoves*
The moose likes JDBC and the fly likes how to access cursor storedprocedure in JDBC program? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how to access cursor storedprocedure in JDBC program?" Watch "how to access cursor storedprocedure in JDBC program?" New topic
Author

how to access cursor storedprocedure in JDBC program?

bm mohan
Greenhorn

Joined: Oct 11, 2013
Posts: 7
Storedprocedure


jdbc program

getting execeptions
java.sql.SQLException: Invalid column index
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:113)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:147)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:209)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameterInternal(OracleCallableStatement.java:122)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:285)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:371)
at table.callstmt_storedprcd.main(callstmt_storedprcd.java:29)
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1077
    
  10

Hi,
I have moved your post to the JDBC forum as your question deals with JDBC and has a better chance of being answered here. Please CarefullyChooseOneForum before you post.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

Your procedure doesn't declare any parameter. It is therefore not possible to register an out parameter on it. Add an out parameter of the ref_cursor type to the procedure and assign the cursor to it, it should then work (assuming you don't iterate over an entire cursor like you do now).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to access cursor storedprocedure in JDBC program?