• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with Result Set's next method

 
Sumeet Anand
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am facing this problem.
When i try to print the one element of result set using the "while" loop,its not getting executed.
********************************************
connection = getConnection();
if(connection != null)
{
cstmt = connection.prepareCall("{call"+queryName+"(?,?) }");

System.out.println("Statement is "+cstmt);
cstmt.registerOutParameter(1,Types.INTEGER);
cstmt.registerOutParameter(2,Types.VARCHAR);
cstmt.execute();
rs = cstmt.getResultSet();
System.out.println("Result set object is "+rs);
}
while(rs.next())//While loop not executed.
{
String id_trans = rs.getString("cd_interface");
System.out.println("Trans id is as"+id_trans);
}
rs.close();
cstmt.close();
******************************************
I guess rs.next() is returning false but donno why ?
When i print out the statement and result set objects, it gives me this.
*******************************************
Statement is com.sybase.jdbc2.jdbc.SybCallableStatement@3f74d

Result set object is com.sybase.jdbc2.jdbc.SybResultSet@6102dc
*******************************************
Can somebody help me out with some good ideas ?
Thanks in advance.
Regards,
Sumeet Anand.
[ January 02, 2003: Message edited by: Sumeet Anand ]
[ January 02, 2003: Message edited by: Sumeet Anand ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic