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
Solved

JDBC: ResultSet.first() method not found error

Posted on 2001-06-04
8
257 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
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:

856 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