Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

last() method of ResultSet fails with 'Unsupported method' SQLException

241 views
Skip to first unread message

Pavel Kopecny

unread,
Feb 15, 2002, 2:43:56 PM2/15/02
to
Hi,

I am using the SQL Server 2000 Driver for JDBC BETA 2
and when I use last() method of a ResultSet I get:
'java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]Unsupported
method: ResultSet.last'
The documentation says this method is supported.
Does anybody know why is this happening please?

Thanks a lot!

Pavel

Sridhar Paladugu[CompCon tech]

unread,
Feb 20, 2002, 4:48:45 PM2/20/02
to
Pavel,

The ResultSet.last() method works fine with beta2 driver.
We have tested the issue and have no problems. If you need further help,
send me your code. I will be glad to help you.

Sridhar Paladugu
Microsoft Developer Support
JDBC Webdata


This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Strategic Technology Protection
Program and to order
your FREE Security Tool Kit, please visit
<http://www.microsoft.com/security>.

Cathal Garvey

unread,
Feb 20, 2002, 11:17:26 PM2/20/02
to
I can't seem to get it working either
"[Microsoft][SQLServer JDBC Driver]Unsupported method: ResultSet.last" using
Beta 2 driver, code is

Class.forName( "com.microsoft.jdbc.sqlserver.SQLServerDriver" );

Connection con = DriverManager.getConnection(
"jdbc:microsoft:sqlserver://localhost:1433;databasename=test;user=sa;passwor
d=sa" );

Statement st = con.createStatement();

String sql = "SELECT id FROM person where username='" +
request.getParameter( "uname" ) + "' AND password='" +
request.getParameter( "md5pwd" ) + "'";

System.out.println( sql );

ResultSet rs = st.executeQuery( sql );

Anything wrong with what i'm doing ?

Thanks.
.cg
"Sridhar Paladugu[CompCon tech]" <sr...@online.microsoft.com> wrote in
message news:c02KxhluBHA.1516@cpmsftngxa08...

"Sridhar Paladugu[CompCon tech]" <sr...@online.microsoft.com> wrote in
message news:c02KxhluBHA.1516@cpmsftngxa08...

Sridhar Paladugu[CompCon tech]

unread,
Feb 21, 2002, 10:44:39 AM2/21/02
to
Hi,
The code looks fine just make sure that you are checking the result set
before calling last() method;
Here is the sample code for that;


if(con!=null){
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery("select * from update_test");
if(rs!=null){
rs.last();
System.out.println(rs.getInt("id"));
}else System.out.println("No Active Connection");

Cathal Garvey

unread,
Feb 21, 2002, 12:53:20 PM2/21/02
to
Thanks Sridhar,

first and last now work and i dont get Invalid Descriptor Index anymore. The
only thing different is the createStatement call .. I was using it with no
args.

Thanks agin,
Cathal


"Sridhar Paladugu[CompCon tech]" <sr...@online.microsoft.com> wrote in

message news:uVVm$6uuBHA.1988@cpmsftngxa07...

0 new messages