This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JDBC and the fly likes Does JDBC:ODBC bridge support scrollable ResultSet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Does JDBC:ODBC bridge support scrollable ResultSet?" Watch "Does JDBC:ODBC bridge support scrollable ResultSet?" New topic
Author

Does JDBC:ODBC bridge support scrollable ResultSet?

Ralph Kehmeier
Greenhorn

Joined: Apr 16, 2005
Posts: 10
Hello All;

I'm using the Java JDBC:ODBC bridge to access a text file. I've tried using both the default, nonscrollable TYPE_FORWARD_ONLY ResultSet, as follows:

Statement SQL_statement = database_connection.createStatement ();

...and a scrollable TYPE_SCROLL_INSENSITIVE ResultSet, as follows:

Statement SQL_statement = database_connection.createStatement
(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);

Given the identical SQL select statement and everything else in both cases, except for the 'createStatement' method, the first technique returns a ResultSet with three rows, and the second technique returns 0 rows, as shown in the second case by the following:

ResultSet resultSet = SQL_statement.executeQuery (someSelectString);
resultSet.last ();
System.out.println ("current row = " + resultSet.getRow ()); <-(displays 0)

My JDBC:ODBC bridge returns the following DatabaseMetaData information:
supportsResultSetType (ResultSet.TYPE_SCROLL_INSENSITIVE) = true
getJDBCMajorVersion() = 2
getJDBCMinorVersion() = 0

I've spent hours scouring the Internet, spoken to it sweetly, held my mouth just right, nothing helps. Any ideas?

Thanks,
Ralph
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I'd have to double check my facts, but Scollable ResultSets are JDBC 2.0? The bridge barely supports JDBC 1.0
Ralph Kehmeier
Greenhorn

Joined: Apr 16, 2005
Posts: 10
Thanks for the input. If the DatabaseMetaData method:
getJDBCMajorVersion()
returns a value of '2', as mentioned above, doesn't that mean that the JDBC:ODBC bridge supports at least JDBC 2.0?

Something that would be helpful is a written specification for the JDBC:ODBC bridge. Does such a thing exist, or would that be expecting too much?

Ralph
 
GeeCON Prague 2014
 
subject: Does JDBC:ODBC bridge support scrollable ResultSet?