Tuesday, February 1, 2022

[SOLVED] Connect MS Access in Java on Debian Linux machine

Issue

Currently I've developed a small desktop application as an enhancement to my project, which reads '.mdb' file and connects as an MS-Access database using 'JDBC-ODBC Driver'.

This is works fine in Windows environment, but I am unable to run the same on Debian-Linux machine.

The code is below:

try 
{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    oAccessConnection = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="+mdbFileName);
} 
catch (Exception oException) 
{
    logger.info("Exception",oException);
}

How can I diagnose the problem?


Solution

JDBC-ODBC bridge won't work in Linux machine, so you have to use other JDBC driver, which will have access to MS-ACCESS directly (not thru ODBC bridge) - try to look in this thread



Answered By - Barmaley
Answer Checked By - Candace Johnson (WPSolving Volunteer)