| 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: 1112
|
|
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.
|
 |
 |
|
|
subject: Error Retreiving a resultset from an oracle stored procedure
|
|
|