0

Can someone explain/elaborate the following limitation mentioned on the JDBC ODBC FAQs list

  • -Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection?
    No. You can open only one Statement object per connection when you are using the JDBC-ODBC Bridge.*

I tried opening multiple statements using JDBC/ODBC bridge drive, but did not get any issues.

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn =  DriverManager.getConnection ("jdbc:odbc:MyDSN", "user", "pwd");
Statement stmt1 = conn.createStatement ();
Statement stmt2 = conn.createStatement ();
ResultSet rs1 = stmt1.executeQuery("select COL1 from TAB1");
ResultSet rs2 = stmt2.executeQuery("select COL2 from TAB2");
if (rs1.next() )
//print COL1
if (rs2.next() )
//print COL2

//close all resources

-- DatabaseMetaData --
getDriverName() JDBC-ODBC Bridge (msorcl32.dll)
getJDBCMajorVersion() 2
getDriverVersion() 2.0001 (02.575.1132)
akjain
  • 1,787
  • 3
  • 20
  • 35
  • 2
    Why are you using the JDBC/ODBC bridge at all? Today all DBMS have very good "native" JDBC (Type4) drivers. There is nearly no reason to use the ODBC bridge (with all its bugs and limitations) –  Oct 01 '12 at 10:22
  • @a_horse_with_no_name I mostly prefer Type4 drivers. I posted this question for clarification purpose. – akjain Oct 01 '12 at 11:24

0 Answers0