Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to access cursor storedprocedure in JDBC program?

 
bm mohan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic