I am trying to retrieve a cursor to return a resultset from an oracle
stored procedure. And I am getting the following error:

ORA-01006: bind variable does not exist             begin
get_message(1); end;

Here's my code:

      Connection c = null;
      ResultSet rs = null;
      CallableStatement cstmt = null;

      try {
        c =
com.nuventive.iwebfoliov2.database.DBAppConnection.getConnection();
        cstmt = c.prepareCall(GET_VALIDATEMESSAGE_STATEMENT);
        cstmt.registerOutParameter(1,OracleTypes.CURSOR);
        cstmt.setInt(1, userID);
        cstmt.execute();
        if(!(cstmt.wasNull())){
          rs = ((OracleCallableStatement)cstmt).getCursor(1);
          while (rs.next()) {
            System.out.println(rs.getString(1));
            MessageCenter mes = new MessageCenter(rs.getString(1),
rs.getString(2), rs.getString(3), rs.getString(4));
            userMessages.add(mes);
          }
        }

Can anyone please provide some help. Thanks.

Sajag Patel
Nuventive
Software Engineer
[EMAIL PROTECTED]

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

Reply via email to