Вопрос

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