Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Does JDBC:ODBC bridge support scrollable ResultSet?

 
Greenhorn
Posts: 11
  • 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: 11
  • 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
 
Willie Smits can speak 40 languages. This tiny ad can speak only one:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic