How to parse the jdbc driver name from the jdbc .jar file

Discussion in 'Java' started by Bruce, Mar 21, 2006.

  1. Bruce

    Bruce Guest

    Hi,

    Is there any safe method which can get the right jdbc driver class name
    out? I used to use "driver.class", but there maybe many XXXDriver.class
    in a single jar file.

    -Bruce
     
    Bruce, Mar 21, 2006
    #1
    1. Advertising

  2. Bruce

    Larry Guest

    What database are you trying to access using Java? SQL Server, DB2,
    Oracle, ???
     
    Larry, Mar 22, 2006
    #2
    1. Advertising

  3. Bruce

    Bruce Guest

    In fact, I am trying to implement a general purpose wrapper for various
    databases. The design is to put the a jdbc driver into a folder named
    "drivers", and my program would register the jdbc driver class right
    and provide user a list of current jdbc driver names.
     
    Bruce, Mar 23, 2006
    #3
  4. You can scan jar-file and find all classes which implement
    java.sql.DriverManager.
     
    =?utf-8?B?0JTQvNC40YLRgNC40Lk=?=, Mar 23, 2006
    #4
  5. Bruce

    Bjorn Abelli Guest

    "???????" <> wrote...
    > You can scan jar-file and find all classes which implement
    > java.sql.DriverManager.


    I think you mean those classes that implements java.sql.Driver.

    The DriverManager *manages* drivers...

    // Bjorn A
     
    Bjorn Abelli, Mar 25, 2006
    #5
    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. YZ
    Replies:
    0
    Views:
    411
  2. Liz
    Replies:
    3
    Views:
    1,005
  3. Betty
    Replies:
    1
    Views:
    9,871
    Juha Laiho
    May 21, 2005
  4. muttley
    Replies:
    0
    Views:
    2,731
    muttley
    Oct 20, 2005
  5. Lew
    Replies:
    0
    Views:
    519
Loading...

Share This Page