Unfortunately, as you have discovered, JDBC drivers are not nearly as
interchangeable as they might be. Many are not even truly compliant with
the JDBC spec. Not to mention the widely-varying dialects of supported
SQL ..... Incidentally, having to traverse the resultset columns in
order IS mentioned by the spec as total "lowest common denominator"
behaviour. Also, I think case-sensitivity is permitted, and depends on
the underlying implementation. The only way round some of these problems
is to query the DatabaseMetaData object returned by the driver to find
out more specifically what it does and does not support.

One final thing though: The JDBC-ODBC bridge is absolutely horrendous -
full of bugs and discrepancies. I strongly recommend using a JDBC-ODBC
brige implementation from a third party vendor, or a completely
different driver altogether, if you're planning on doing anything
non-trivial.

Cheers

Alasdair
A mailing list for Enterprise JavaBeans development wrote:
>
> Though this is not directly related to EJB, I found it pertinent, so please
> bear with me.
> We have been using a Type-4 JDBC driver for our application (that uses swing
> etc). Now when we are trying to move to a web-based application using
> Servlets + EJB, we figured we could as well use type-1 driver (jdbc-odbc),
> if only to test some of our code. Yes, we are on NT4.0.
> But we see plenty of differences in terms of actual implementation. What I
> mean is the code that was working smmothly with the other driver needs to be
> tinkered with to make it work here.
> e.g.:
> if I have a query that goes ... "select a,b, from tablex"
> (using jdbc-odbc bridge driver),
> a) I am forced to 'get' the columns in the same order as in the query, a
> first and then b.
> b) the odbc- layer is case sensitive.  (column names)
> c) there seems to be some difference in the way a stored proc is called.
>
> Are we expected to live with one 'driver' ? I always dreamt that changing
> the driver should not result in changes at the code level...
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

  • JDBC Rahul Gudipati
    • Alasdair Gilmour

Reply via email to