Solved

JDBC: ResultSet.first() method not found error

Posted on 2001-06-04
8
252 Views
Last Modified: 2008-02-26
Hi,
When I add the line rsResultSet.first() to my code on compiling I am getting the error first() is not a method of ResultSet.
I am using the JRE 1.3.
I am using the microsoft driver
("com.ms.jdbc.odbc.JdbcOdbcDriver");
as the sun driver gave error class not found.

Am I not compliant with JDBC 2.0? How do I find out?

Any help appreciated,
moz
0
Comment
Question by:mozimoz
8 Comments
 
LVL 2

Expert Comment

by:dbaora
Comment Utility
Hi,
If you are working with Oracle database it is best you download the latest jdbc/odbc drivers.
regards,
dbaora.
0
 

Author Comment

by:mozimoz
Comment Utility
Thanks dbaora,
I am using MS SQL Server.
I have JRE 1.3 does this give me the latest jdbc/odbc driver? How do I find out?

tia moz
0
 

Expert Comment

by:polina
Comment Utility
The first() is not the valid method of the ResultSet.
I always use next() to get to the query results:
Statement stmt = conn.createStatement();
rset = stmt.executeQuery(statement);
rset.next();
sDisplay = rset.getString(1);
0
 

Author Comment

by:mozimoz
Comment Utility
Thanks Polina,

I am trying to discover if the result set is empty without calling rs.next().
In my jdbc 2.0 book there a set of new functions that are unavailable to me. One of them is first(), another previous() and the functionality for craeting scrollable result sets. eg conn.createStatement(intResultSetType, intResultSetConcurrency).

How do I tell whether my SQL Server driver is JDBC 2.0 compliant?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Expert Comment

by:polina
Comment Utility
Try to search Oracle site http://metalink.oracle.com.
You have to register but it's free and they have a lot
info on versioning and compatibility.
0
 

Expert Comment

by:tjingl
Comment Utility
hi,
if the jdbc 2.0 methods can't compile or return exceptions, the possible problem is the jdbc driver doesn't support these jdbc2.0 features. try downloading some other mssql jdbc2.0 compliant drivers.

u may get an evaluation copy of OPTA-2000 from
http://www.inetsoftware.de

i have tested the driver and it support the methods u mentioned.
0
 
LVL 5

Expert Comment

by:vemul
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- To be PAQ'ed and points NOT refunded

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

vemul
Cleanup Volunteer
0
 

Accepted Solution

by:
Banath earned 0 total points
Comment Utility
Per recommendation - PAQ'ed and points NOT refunded

Banath
EE Moderator
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now