سؤال

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.

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top