Solved

JDBC: ResultSet.first() method not found error

Posted on 2001-06-04
8
260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

623 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