Question

How to run the swing application without creating the DSN on the client

I am working on a swing application in which i have to give the mdb database to the client with password protection , i dont want the need to create DSN on client side

Is there any possible way to give the database path in the coding part rather than specifying the DSN name. because DSN creation is a complicated task for client.

Was it helpful?

Solution

USE below code to create your connection:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\\as\\sampleDB.mdb");

This might help You.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top