run swing application without DSN creation

2019-06-06 20:22发布

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.

1条回答
我想做一个坏孩纸
2楼-- · 2019-06-06 20:30

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.

查看更多
登录 后发表回答