Hi,
I have used JDBC ODBC driver for some time in Java 1 and Java 2. The driver is generally stable, but I've found it can throw exceptions e.g. General Error alot. It also depends on the load, what db pooling your using. I would suggest you use ODBC pooling and let the OS handle it.
The only suggestion I can make is to ensure that when the JDBC ODBC driver throws exceptions, re-establish the connection object and try again.
jdbc-odbc bridge has many limitations. I think it is deemed unstable because people assume that you can use all jdbc 2.0 features when using the bridge. There is also a few anomalies, but a quick search through the jdbc forum should turn up the problems associated with a given database.
The real question is does the jdbc-odbc bridge provide you with the features that you need to successfully complete your commercial application.
IMHO, I would lean towards finding a type 4 driver for a commercial application.
This is a good starting link:
http://java.sun.com/products/jdbc/faq.html
a quote from Sun:
"Note that we do not recommend using the Bridge except for experimental purposes or when you have no other driver available. "
Jamie
I used jdbc-odbc in jdk 1.1.4 with a MS SQL database. The database was 250 gig, growing at a rate of 400meg a day, it had a daily load of 200+ users and a nitely load of 3000+ reports.
There was never a single error traced to the jdbc-odbc bridge.
Although Sun recommends that people use a different driver, one should keep in mind that the bridge is written by a 3rd party company that also sells jdbc products. One might gather that, to get that other company to write the code, they might not want to claim that it is the best driver in the world.
From the FAQ, this one has a lot of potential to mess you up:
15. 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 have an application that needs to work with SQL Server, SQL Anywhere and Oracle. I get the user, password and ODBC DSN from a text file, but I dont know which RDBMS the DSN connects to until after its connected. I thought using the bridge it wouldnt matter - but I had trouble because of the above. What I did is after the connection is made through the bridge, get the meta data for the connection using the bridge and then connecting to JDBC driver for whatever database it is using. I wouldnt get my hopes up if you want to do anything at all sophisticated.
> From the FAQ, this one has a lot of potential to mess
> you up:
>
> 15. 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.
>
Wrong. That isn't what it says.
It says that you can only have one active statement per connection.
> I have an application that needs to work with SQL
> Server, SQL Anywhere and Oracle. I get the user,
> password and ODBC DSN from a text file, but I dont
> know which RDBMS the DSN connects to until after its
> connected. I thought using the bridge it wouldnt
> matter - but I had trouble because of the above.
Persumably you are referring to having more than one active statement per connection.
Frankly I don't see the point. First the specification allows a driver to block one statement until the other completes. That means that, generically, you can't use it in threads. And if you are not using it in more than one thread it is pointless (because you should either be only using one SQL or your access is sequential anyways.)
> What I did is after the connection is made through the
> bridge, get the meta data for the connection using the
> bridge and then connecting to JDBC driver for whatever
> database it is using. I wouldnt get my hopes up if
> you want to do anything at all sophisticated.
And exactly what sort of sophisticated things might you being running across that a 200+ user, 24x7 application, 250 gig database doesn't?