Connector-odbc or Connector-java ?

Discussion in 'Java' started by carmelo, Oct 8, 2008.

  1. carmelo

    carmelo Guest

    Hi everybody,
    I need to develop a java app which have to connect to a remote mysql
    db. Which one between Connector-odbc and Connector-java should I use?


    Thank you very much in advance
     
    carmelo, Oct 8, 2008
    #1
    1. Advertising

  2. On 8-10-2008 11:38, carmelo wrote:
    > Hi everybody,
    > I need to develop a java app which have to connect to a remote mysql
    > db. Which one between Connector-odbc and Connector-java should I use?
    >
    >
    > Thank you very much in advance


    Use Connector/J. It's the most concise way to connect to a MySQL
    database using JDBC.

    Connector/ODBC would allow you to connect to a MySQL using the ODBC. For
    a Java application you then could use the JDBC-ODBC bridge, but that
    would be "a bridge too far".

    <http://dev.mysql.com/usingmysql/java/>
    <http://www.mysql.com/products/connector/j/>
    --
    Regards,

    Roland
     
    Roland de Ruiter, Oct 8, 2008
    #2
    1. Advertising

  3. carmelo

    carmelo Guest

    On 8 Ott, 12:26, Roland de Ruiter <>
    wrote:
    > On 8-10-2008 11:38, carmelo wrote:
    >
    > > Hi everybody,
    > > I need to develop a java app which have to connect to a remote mysql
    > > db. Which one between Connector-odbc and Connector-java should I use?

    >
    > > Thank you very much in advance

    >
    > Use Connector/J. It's the most concise way to connect to a MySQL
    > database using JDBC.
    >
    > Connector/ODBC would allow you to connect to a MySQL using the ODBC. For
    > a Java application you then could use the JDBC-ODBC bridge, but that
    > would be "a bridge too far".
    >
    > <http://dev.mysql.com/usingmysql/java/>
    > <http://www.mysql.com/products/connector/j/>
    > --
    > Regards,
    >
    > Roland


    Thank you Roland.
    Surely using JDBC is faster than using the bridge... isn't it?
     
    carmelo, Oct 8, 2008
    #3
  4. On 8-10-2008 12:50, carmelo wrote:
    > On 8 Ott, 12:26, Roland de Ruiter <>
    > wrote:
    >> On 8-10-2008 11:38, carmelo wrote:
    >>
    >>> Hi everybody,
    >>> I need to develop a java app which have to connect to a remote mysql
    >>> db. Which one between Connector-odbc and Connector-java should I use?
    >>> Thank you very much in advance

    >> Use Connector/J. It's the most concise way to connect to a MySQL
    >> database using JDBC.
    >>
    >> Connector/ODBC would allow you to connect to a MySQL using the ODBC. For
    >> a Java application you then could use the JDBC-ODBC bridge, but that
    >> would be "a bridge too far".
    >>
    >> <http://dev.mysql.com/usingmysql/java/>
    >> <http://www.mysql.com/products/connector/j/>
    >> --
    >> Regards,
    >>
    >> Roland

    >
    > Thank you Roland.
    > Surely using JDBC is faster than using the bridge... isn't it?


    Yes, it is.
    --
    Regards,

    Roland
     
    Roland de Ruiter, Oct 8, 2008
    #4
  5. On 8-10-2008 14:20, Lew wrote:
    > carmelo wrote:
    >>> Surely using JDBC is faster than using the bridge... isn't it?

    >
    > Roland de Ruiter wrote:
    >> Yes, it is.

    >
    > Measurably?
    >


    Sure. In a project I was involved a couple of years ago, direct JDBC
    proved to be faster than going through the JDBC-ODBC bridge.
    --
    Regards,

    Roland
     
    Roland de Ruiter, Oct 8, 2008
    #5
  6. carmelo

    Arne Vajhøj Guest

    carmelo wrote:
    > I need to develop a java app which have to connect to a remote mysql
    > db. Which one between Connector-odbc and Connector-java should I use?


    Connector/J is much better.

    The JDBC-ODBC bridge has serious bugs in multithreaded apps.

    ODBC is very hard to troubleshoot due to cryptic error messages.

    It will perform better.

    Arne
     
    Arne Vajhøj, Oct 8, 2008
    #6
  7. carmelo

    carmelo Guest

    On 8 Ott, 23:54, Arne Vajhøj <> wrote:
    > carmelo wrote:
    > > I need to develop a java app which have to connect to a remote mysql
    > > db. Which one between Connector-odbc and Connector-java should I use?

    >
    > Connector/J is much better.
    >
    > The JDBC-ODBC bridge has serious bugs in multithreaded apps.
    >
    > ODBC is very hard to troubleshoot due to cryptic error messages.
    >
    > It will perform better.
    >
    > Arne


    Ok, thank you guys!
     
    carmelo, Oct 9, 2008
    #7
  8. Lew wrote:
    > carmelo wrote:
    >>> Surely using JDBC is faster than using the bridge... isn't it?

    >
    > Roland de Ruiter wrote:
    >> Yes, it is.

    >
    > Measurably?


    Interesting question.

    I expected it to be very significant.

    But for the fun of it I tried creating a small test
    program.

    The results were:

    MySQL Connector/J:
    INSERT 10000 rows: 1828 milliseconds
    SELECT 10000 rows 50 times: 1797 milliseconds
    SELECT 1 row 10000 times: 2453 milliseconds
    JDBC ODBC bridge:
    INSERT 10000 rows: 1781 milliseconds
    SELECT 10000 rows 50 times: 5641 milliseconds
    SELECT 1 row 10000 times: 3031 milliseconds
    MySQL Connector/J:
    INSERT 10000 rows: 1656 milliseconds
    SELECT 10000 rows 50 times: 1609 milliseconds
    SELECT 1 row 10000 times: 2000 milliseconds
    JDBC ODBC bridge:
    INSERT 10000 rows: 1656 milliseconds
    SELECT 10000 rows 50 times: 5609 milliseconds
    SELECT 1 row 10000 times: 2891 milliseconds
    MySQL Connector/J:
    INSERT 10000 rows: 1625 milliseconds
    SELECT 10000 rows 50 times: 1578 milliseconds
    SELECT 1 row 10000 times: 2000 milliseconds
    JDBC ODBC bridge:
    INSERT 10000 rows: 1625 milliseconds
    SELECT 10000 rows 50 times: 5609 milliseconds
    SELECT 1 row 10000 times: 2735 milliseconds

    For this particular test program with my versions of the
    drivers and my version of MySQL it seems as if:
    - INSERT is the same speed
    - SELECT is 50%-250% slower
    with JDBC-ODBC bridge.

    Measurable !!

    Arne
     
    Arne Vajhøj, Oct 11, 2008
    #8
  9. On 9-10-2008 1:31, Lew wrote:
    > Roland de Ruiter wrote:
    >> On 8-10-2008 14:20, Lew wrote:
    >>> carmelo wrote:
    >>>>> Surely using JDBC is faster than using the bridge... isn't it?
    >>>
    >>> Roland de Ruiter wrote:
    >>>> Yes, it is.
    >>>
    >>> Measurably?
    >>>

    >>
    >> Sure. In a project I was involved a couple of years ago, direct JDBC
    >> proved to be faster than going through the JDBC-ODBC bridge.

    >
    > So if you measured it, how much was the difference?
    >

    IIRC, JDBC-ODBC bridge was about 20%-25% slower. We reused connections
    (i.e. connection pooling) and the project involved data retrieval only,
    i.e. it only used SELECT statements, no INSERTs or UPDATEs.
    --
    Regards,

    Roland
     
    Roland de Ruiter, Oct 12, 2008
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mikael Syska
    Replies:
    5
    Views:
    2,374
    Mikael Syska
    Jan 15, 2005
  2. Robin

    Oracle.Net Data Connector

    Robin, Jan 22, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    5,105
    Ken Cox [Microsoft MVP]
    Jan 22, 2005
  3. wildsurfer
    Replies:
    0
    Views:
    549
    wildsurfer
    Sep 25, 2004
  4. Ian S. Nelson

    PostgreSQL connector and Zope connector

    Ian S. Nelson, Jul 26, 2004, in forum: Python
    Replies:
    2
    Views:
    451
    Lee Harr
    Jul 27, 2004
  5. Wes Gamble
    Replies:
    1
    Views:
    160
    Gerardo Santana Gómez Garrido
    Apr 5, 2006
Loading...

Share This Page