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
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
posted 17 years ago
I am using MS SQL Server 2000 on Windows 2000 Pro.