The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
February 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Reply to u r question..

Posted by satish on April 09, 2001 at 1:08 AM

> When i was working on jdbc,i encountered a problem in using the previous method of ResultSet Interface.I tried all the possiblities i could but i didn't get the output.Can any one help me out to understand the method.

hi.

balaji.....

it depends on what version of jdbc api u r using,suppose if u r using JDBC1.0 API u have only one option of navigating ie next() method of ResultSet class....
For example....
ResultSet rs=statement.executeQuery("Select a,b,c,from emp");
while(rs.next())
{
}
all ur data will be stored in the resultset object ie.(rs)
so in order to retrieve the data from database u have to make
use of getXXX()....

if u want to make use of previous method then u have to declare as....

rs.afterLast();
while(rs.previous())
{
}
for this u have to make use of JDBC2.0 API then it works....(ie ur driver should make use of this API's...)



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us