my dog learned polymorphism
The moose likes JDBC and Relational Databases 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


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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: 1101
    
  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: 3718
    
  61

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: how to access cursor storedprocedure in JDBC program?
 
It's not a secret anymore!