PDA

View Full Version : Java / Oracle Callable Statement with Null ResultSet


Andy Flowers
06-27-2003, 05:36 AM
Try

ResultSet rs2 = (ResultSet)callstmt.getObject(1);


"echohead" <echohead@netzero.net> wrote in message
news:373d8fb9.0306270518.30cf2e34@posting.google.com... This is my first shot at a callablestatement, and have had some basic problems (such as wrong number or type of parameters sent) getting this to work. I think I have it working now, except for the fact that my result set continues to be null, and there should be records. Can anyone provide any insight into whether the following code is correct, or, any changes I need to make? // CODE SNIP java.sql.Date d = new java.sql.Date(1994, 1, 1); java.sql.Connection connX = com.xxxx.XXXX.XXXX.DBODSConnection.getConnection("DEVELOPMENT"); java.sql.CallableStatement callstmt = null; callstmt = connX.prepareCall("begin ? := PKSTATETAX.GETSTATETAXLIST(?, ?); end;"); callstmt.registerOutParameter(1, oracle.jdbc.OracleTypes.CURSOR); callstmt.setString(2, "PT"); callstmt.setDate(3, d); callstmt.execute(); java.sql.ResultSet rs2 = (java.sql.ResultSet) callstmt.getResultSet(); // QUICK TEST OF RESULTSET if (rs2 == null) {out.println("RS null");} else { int iCount2 = 0; while (cursor.next()) { iCount2 = iCount2 + 1; out.println(iCount2); } } Thanks for your help.

echohead
06-27-2003, 09:12 AM
Thanks... That was it.....


MyLounge.com Site Map
Forum: Cars, Cell Phone, Database, Games, Home Improvement, IT, Music, School, Sports, Web Design, Web Server, Weight Loss

The MyLounge.com forum is intended for informational use only and should not be relied upon and is not a substitute for any advice. The information contained on MyLounge.com are opinions and suggestions of members and is not a representation of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for the accuracy, completeness or usefulness of any postings or the qualifications of any person responding. Please consult a expert or seek the services of an attorney in your area for more accuracy on your specific situation. Please note that our forums also serve as mirrors to Usenet newsgroups. Many posts you see on our forums are made by newsgroup users who may not be members of MyLounge.com Term of Service