Solved

JDBC: ResultSet.first() method not found error

Posted on 2001-06-04
8
258 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
Industry Leaders: 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delete Android all or certain applications data programmatically 9 106
eclipse console opening separately 2 35
Chrome and Firefox Java 5 66
Bot application - advice 3 58
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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 will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to implement Singleton Design Pattern in Java.

685 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