Coley
Coley

Reputation: 717

Using a file DSN with JDBC

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.

Upvotes: 3

Views: 6236

Answers (1)

duffymo
duffymo

Reputation: 308998

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?

Upvotes: 2

Related Questions