Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a file DSN with JDBC

Tags:

java

jdbc

dsn

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.

like image 856
Coley Avatar asked Jun 03 '26 07:06

Coley


1 Answers

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?

like image 66
duffymo Avatar answered Jun 05 '26 21:06

duffymo