Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Does JDBC:ODBC bridge support scrollable ResultSet?

 
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
 
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
 
If you are using a wood chipper, you are doing it wrong. Even on this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!