aspose file tools*
The moose likes JDBC and the fly likes Error Retreiving a resultset from an oracle stored procedure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Error Retreiving a resultset from an oracle stored procedure" Watch "Error Retreiving a resultset from an oracle stored procedure" New topic
Author

Error Retreiving a resultset from an oracle stored procedure

sajag patel
Greenhorn

Joined: Dec 20, 2002
Posts: 7
Hi all,
Can anyone help me, and tell me why I am getting a javax.servlet.ServletException: No data read error.
Here's the code:
Connection c = null;
ResultSet rs = null;
CallableStatement cstmt = null;

try {
public static String GET_VALIDATEMESSAGE_STATEMENT = "call get_message(?, ?)";
cstmt = c.prepareCall(GET_VALIDATEMESSAGE_STATEMENT);
cstmt.registerOutParameter(2,OracleTypes.CURSOR);
cstmt.setInt(1, userID);
cstmt.execute();
if(!(cstmt.wasNull())){
rs = (ResultSet)cstmt.getObject(2);
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);
}
}
rs.close();
//ps.close();
cstmt.close();
c.close();
Any help would be much appreciated.
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1135

Hi Sajag,
Although I haven't tested your code, I believe you should change this line:

with this:

since Oracle supports the JDBC escape syntax.
Hope this helps.
Good Luck,
Avi.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error Retreiving a resultset from an oracle stored procedure