This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JDBC and the fly likes Scrollable ResultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Scrollable ResultSet" Watch "Scrollable ResultSet" New topic
Author

Scrollable ResultSet

Jaggi Kunal
Ranch Hand

Joined: Jan 21, 2003
Posts: 45
In the JDBC API 2.0 (javax.sql) How can be obtain a scrollable ResultSet corresponding to a PreparedStatement object? I
Following is a code snippet which obtains a scrollable ResultSet from a Statement object:
Statement myStatement =
conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
I have JDK1.4. But when I try to print the API using javap javax.sql.Connection I don’t get the output. What do we need to install for JDBC2.0?
Regards,
Kunal Jaggi
SCJP2
Jacob George
Ranch Hand

Joined: Jun 26, 2001
Posts: 46
Originally posted by Jaggi Kunal:
I have JDK1.4. But when I try to print the API using javap javax.sql.Connection I don’t get the output. What do we need to install for JDBC2.0?

!!!
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

First off, the JDBC 2.0 is outlined by the java.sql specification ( not javax.sql ) so no further downloads are needed as it is included in the sdk 1.2 and up. But, most classes ( including Connection, ResultSet, Statement and most other classes ) are only an interface. So you have to find a jdbc driver to access your database that is jdbc 2.0 certified to be sure that these methods are implemented and ensure full functionality.
If you let us know which database you are using, maybe we can suggest some drivers that have worked for us.
just a note,
scrollable resultsets are highly over rated. They consume memory resources ( as the results are just cached to memory ) as well as tying up valuable database resources. You are better off saving your query results to a collection and using the Collection of data like you would the scrollable resultset.
Jamie
Jaggi Kunal
Ranch Hand

Joined: Jan 21, 2003
Posts: 45
I am using MS SQL Server 2000 on Windows 2000 Pro.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scrollable ResultSet
 
Similar Threads
JDBC
JDBC
Scrollable ResultSet
JDBC Scrollable ResultSet
Scrollable ResultSet not working