Microsoft Access DB Driver for JDBC

Discussion in 'Java' started by Jsnail, May 10, 2005.

  1. Jsnail

    Jsnail Guest

    Does any body know of any freeware ms access drivers for jdbc that
    allow direct access to an ms access db. The jdbc odbc bridge works but
    i dont know how to dynamically add odbc data connections in windows
    (Some code to do this would also help).
    Jsnail, May 10, 2005
    #1
    1. Advertising

  2. Jsnail wrote:
    >
    > Does any body know of any freeware ms access drivers for jdbc that
    > allow direct access to an ms access db. The jdbc odbc bridge works but
    > i dont know how to dynamically add odbc data connections in windows
    > (Some code to do this would also help).


    There is no JDBC driver for Access.

    The only way to add ODBC datasources in Java is to use JNI.

    You need to get a better db.

    --
    Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
    ==============================================================
    * The Ultimate DBMS is here!
    * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
    Lee Fesperman, May 10, 2005
    #2
    1. Advertising

  3. Jsnail

    James Croft Guest

    Jsnail wrote:
    > Does any body know of any freeware ms access drivers for jdbc that
    > allow direct access to an ms access db. The jdbc odbc bridge works but
    > i dont know how to dynamically add odbc data connections in windows
    > (Some code to do this would also help).
    >


    I don't know of any classes for manipulating the registry (I'm new to
    Java). But I've created DSNs on the fly with C# by manipulating the
    registry keys under:

    HKEY_LOCAL_MACHINE\SOFTWARE\ODBC

    If you can find a Java class for registry manipulation coding this is
    straight forward enough. Create a DSN manually and take a look at the
    changes under that reg key.

    HTH

    James
    James Croft, May 10, 2005
    #3
  4. On 10.05.2005 09:05 James Croft wrote:

    > Jsnail wrote:
    >
    >> Does any body know of any freeware ms access drivers for jdbc that
    >> allow direct access to an ms access db. The jdbc odbc bridge works but
    >> i dont know how to dynamically add odbc data connections in windows
    >> (Some code to do this would also help).
    >>

    >
    > I don't know of any classes for manipulating the registry (I'm new to
    > Java). But I've created DSNs on the fly with C# by manipulating the
    > registry keys under:
    >
    > HKEY_LOCAL_MACHINE\SOFTWARE\ODBC
    >
    > If you can find a Java class for registry manipulation coding this is
    > straight forward enough. Create a DSN manually and take a look at the
    > changes under that reg key.


    You don't need a DSN for accessing Access DBs (or other ODBC connections).
    Google for "DSN less connection java"

    http://www.google.com/search?hl=en&q=dsn less connection odbc java&btnG=Google Search

    Thomas
    Thomas Kellerer, May 10, 2005
    #4
  5. Jsnail

    James Croft Guest

    Lee Fesperman wrote:
    > Jsnail wrote:
    >
    >>Does any body know of any freeware ms access drivers for jdbc that
    >>allow direct access to an ms access db. The jdbc odbc bridge works but
    >>i dont know how to dynamically add odbc data connections in windows
    >>(Some code to do this would also help).

    >
    >
    > There is no JDBC driver for Access.



    The JDBC-ODBC bridge is intended (dunno, never used it although the
    poster says it works) to allow Java apps to talk to any ODBC datasource.

    http://java.sun.com/j2se/1.4.2/docs/guide/jdbc/getstart/bridge.doc.html


    >
    > The only way to add ODBC datasources in Java is to use JNI.
    >


    Security issues aside wouldn't it be possible to create a temporary .reg
    file with the changes needed and call 'regedit myupdate.reg' using Javas
    Runtime.exec() function?

    As I said before I'm fairly new to Java so have no idea if its security
    features will block this. If it worked it'd be easier than JNI.


    > You need to get a better db.
    >


    As ghastly as Access is to real men who drink real beer and use real
    databases there may be a perfectly valid reason for using it, eg. the
    boss/client demanding that it be used.

    Cheers,

    James
    James Croft, May 10, 2005
    #5
  6. Jsnail

    James Croft Guest

    Thomas Kellerer wrote:
    >
    > You don't need a DSN for accessing Access DBs (or other ODBC connections).
    > Google for "DSN less connection java"
    >
    > http://www.google.com/search?hl=en&q=dsn less connection odbc java&btnG=Google Search
    >
    > Thomas


    I guess how the Access DB is to be used will decide if this is useful or
    not. AFAIK (let me know if this is wrong) DSNs allow multiple
    connections/updates without the file locking issues a individual
    processes trying to get the file open for writing would have.

    James
    James Croft, May 10, 2005
    #6
  7. Jsnail

    Jsnail Guest

    no i'm a student and the ms sql server database is regarded the holy
    grail around here
    Jsnail, May 10, 2005
    #7
  8. Jsnail

    Jsnail Guest

    thanks man helped alot!!
    Jsnail, May 10, 2005
    #8
  9. Jsnail

    Josef Garvi Guest

    Jsnail wrote:
    > Does any body know of any freeware ms access drivers for jdbc that
    > allow direct access to an ms access db. The jdbc odbc bridge works but
    > i dont know how to dynamically add odbc data connections in windows
    > (Some code to do this would also help).


    I simply specify the path to the Access db in my connection string.

    Example:
    String dbUrl = "jdbc:eek:dbc:MS Access Database;DBQ=C:\\MyFolder\\myDb.mdb;"
    Connection con = DriverManager.getConnection(dbUrl, "", "");


    PS. This discussion seems more appropriate for the databases ng, so I've
    pointed the follow-up there.

    --
    Josef Garvi

    "Reversing desertification through drought tolerant trees"
    http://www.eden-foundation.org/

    new income - better environment - more food - less poverty
    Josef Garvi, May 10, 2005
    #9
  10. James Croft wrote:
    >
    > Lee Fesperman wrote:
    > > Jsnail wrote:
    > >
    > >>Does any body know of any freeware ms access drivers for jdbc that
    > >>allow direct access to an ms access db. The jdbc odbc bridge works but
    > >>i dont know how to dynamically add odbc data connections in windows
    > >>(Some code to do this would also help).

    > >
    > > There is no JDBC driver for Access.

    >
    > The JDBC-ODBC bridge is intended (dunno, never used it although the
    > poster says it works) to allow Java apps to talk to any ODBC datasource.


    Well, the OP mentioned the JDBC-ODBC bridge, so it was obvious that he was looking for a
    'native' JDBC driver for Access.

    > >
    > > The only way to add ODBC datasources in Java is to use JNI.
    > >

    >
    > Security issues aside wouldn't it be possible to create a temporary .reg
    > file with the changes needed and call 'regedit myupdate.reg' using Javas
    > Runtime.exec() function?
    >
    > As I said before I'm fairly new to Java so have no idea if its security
    > features will block this. If it worked it'd be easier than JNI.


    Java security might block exec() but doesn't care what you execute with it.

    > > You need to get a better db.
    > >

    >
    > As ghastly as Access is to real men who drink real beer and use real
    > databases there may be a perfectly valid reason for using it, eg. the
    > boss/client demanding that it be used.


    I'll leave it to the OP to clarify that, but I was giving very good advice in general
    .... and not just because of JDBC-ODBC problems.

    --
    Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
    ==============================================================
    * The Ultimate DBMS is here!
    * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
    Lee Fesperman, May 10, 2005
    #10
  11. Jsnail wrote:
    >
    > no i'm a student and the ms sql server database is regarded the holy
    > grail around here


    Then, why were you asking about Access? Are you an atheist around there?

    --
    Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
    ==============================================================
    * The Ultimate DBMS is here!
    * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
    Lee Fesperman, May 10, 2005
    #11
    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. Replies:
    0
    Views:
    3,557
  2. bazzer
    Replies:
    0
    Views:
    891
    bazzer
    Mar 24, 2006
  3. Betty
    Replies:
    1
    Views:
    9,843
    Juha Laiho
    May 21, 2005
  4. Bruce
    Replies:
    4
    Views:
    735
    Bjorn Abelli
    Mar 25, 2006
  5. Lew
    Replies:
    0
    Views:
    501
Loading...

Share This Page