Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Does JDBC:ODBC bridge support scrollable ResultSet?

 
Ralph Kehmeier
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic