I am trying to make the connection between java and ms access database. I want to make the connection without creating the DSN. I am using the following code but it is throwing the exception "Data source name not found exception "
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("Jdbc:Odbc:Driver={Microsoft Access
Driver(*.mdb)}; dbq=d:/newfolder/db11.mdb");
Statement st=con.createStatement();
}
catch(Exception ex)
{
ex.printStackTrace();
}
it should be like this:
Connection con = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=/db.accdb");