How to Connect to MS Access Database using JDBC:ODBC Connection

  1. Depending on whether your Java application is 32-bit or 64-bit, choose the correct ODBC Data Source Administrator (64bit or 32 bit) to create the Data Source Name. Otherwise, the connection cannot be established.
      • If your Java application is 64-bit then use ODBC Data Source Administrator 64-bit
      • If your Java application is 32-bit then use ODBC Data Source Administrator 32-bit
  2. Open ODBC Data Source Administrator (make sure the correct version is used).
  3. Select “System DSN” tab. Click “Add”.
    JDBC-01
  4. In this example, we are connecting to MS Access database, in “Create New Data Source”, select “Microsoft Access Driver (*.mdb, *.accdb)” in the list. Click “Finish”.
    JDBC-02
  5. In “ODBC Microsoft Access Setup”, enter any “Data Source Name”. This name will be used in DBeaver later. So remember it. After that click “Select…” button.
    JDBC-03
  6. Now you have to locate your MS Access file. In this example we use “SMSEngine5.mdb”. Click “OK”.
    JDBC-04
  7. Example of the Data Source Name created.
    JDBC-05
  8. Open DBeaver (or any other database management tool). Click on “Database -> New Database Connection”
    JDBC-06
  9. In “Connect to database”, select “ODBC” in the list. Click “Next”
    JDBC-07
  10. Insert “Database/Schema” name the same like you created earlier in ODBC Data Source Administrator. Click “Test Connection” to test the ODBC connection.
    JDBC-08
  11. If everything is setup right, you will get the below message. Click “Finish”
    JDBC-09