Isaac,
Can you please try with the following:
////////////////////////////////////
try
{
Statement myStatement =
dbConn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY
);
ResultSet rSet = myStatement.executeQuery ("SELECT Vendor_Id FROM
DR_Vendor");
rSet.last();
System.out.println("Total rows:"+rSet.getRow());
}
catch (Exception e )
{
System.out.println("SQLException"+e.getMessage());
}
finally
{
try
{
dbConn.close();
}
catch(SQLException e)
{
System.out.println("SQLException: Can't close");
}
}
///////////////////////////////////////
Where dbConn is the connection object..
I am sure it will work..
Cheers,
Nikhil
>From: Gary Lyons <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: JDBC - Getting row number
>Date: Wed, 20 Sep 2000 17:59:36 -0400
>
>Isaac,
>
>The jdbc implementation varies from driver to driver and db to db. So not
>all
>methods work in all drivers. For instance I use msql a lot and there is no
>way
>to get the number of rows returned without reading them all in like:
>
>while(rs.next()){
>
>do something
>}
>
>You may be experiencing the same problem
>
>Gary Lyons
>
>Isaac Zinner wrote:
>
> > Hi All !
> >
> > I'm trying to get row no. from a big result set (>2000 rows).
> > When I try rs.absolute with a value higher than 1800~ and then
>rs.getRow I
> > get 0.(same with negative no.)
> > When I try rs.last() and then rs.getRow I still get 0 ( tried previous()
> > too). However when I print the rows I do get them from
> > the end correctly . How do I get the cursor to be positioned on the last
> > row so I can get it's no. (with getRow) and not 0.
> >
> > Thanks
> >
> >
>___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
>body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html