Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

JDBC: ResultSet.first() method not found error

Posted on 2001-06-04
8
Medium Priority
?
265 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
ID: 6152005
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
ID: 6152038
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
ID: 6153394
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:mozimoz
ID: 6155214
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
 

Expert Comment

by:polina
ID: 6155675
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
ID: 6176411
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
ID: 7752096
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
ID: 7842666
Per recommendation - PAQ'ed and points NOT refunded

Banath
EE Moderator
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Suggested Courses

886 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