Using a file DSN with JDBC

5.9k Views Asked by At

I can happily connect to a System DSN using JDBC:

DriverManager.getConnection("jdbc:odbc:SysDSN");

If I try and use a File DSN however I get an error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Using:

DriverManager.getConnection("jdbc:odbc:FileDSN");

I've tried specifying a path to the File DSN and still get no joy.

1

There are 1 best solutions below

4
On

I'd recommend using an DSN-less connection URL, as shown here:

Creating a DSN-less connection for MS Access within Java

You won't have to create a DSN that way.

PS - You did create the data source before you tried it your way, didn't you?