JDBC-ODBC Bridge


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: JDBC-ODBC Bridge

  1. #1
    Seema Guest

    JDBC-ODBC Bridge


    hi

    When I load a JDBC-ODBC bridge driver , why do I need to use the
    Class.forName() method. It works the same way even when I make a driver object
    using the new() operator.

    JdbcOdbcDriver d=new JdbcOdbcDriver();

    Is there any difference ?

    Thanx
    Seema

  2. #2
    Nikhil Guest

    Re: JDBC-ODBC Bridge


    "Seema" <seemamani@engineer.com> wrote:
    >
    >hi
    >
    >When I load a JDBC-ODBC bridge driver , why do I need to use the
    >Class.forName() method. It works the same way even when I make a driver

    object
    >using the new() operator.
    >
    >JdbcOdbcDriver d=new JdbcOdbcDriver();
    >
    >Is there any difference ?
    >
    >Thanx
    >Seema


    Hi seema,
    I hope the following is giving you the answer:
    To work with the JDBC driver two things are needed with the jdbc driver
    -- load and register.
    So if you create an instance of the driver, I think you need to register
    it explicitely by calling
    Drivermanager.registerDriver().Otherwise using
    a) Class.forName() , creates an instance of the driver and calls the registerDriver()
    method of that
    instance autometically.

    OR
    b) add the driver name in the Jdbc.Drivers System proprty, whenever you
    call the first method of the
    DriverManager it will load and register all the drivers in that list separeted
    by ":".

    Hope it is clear.
    Bye
    Nikhil


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center