• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problems with Result Set's next method

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic