Link to home
Start Free TrialLog in
Avatar of Aurii
Aurii

asked on

Set Access database DSN through code

I have developed java application. I am using Access database. I have to set DSN manually. I want to do it hard code in my application. How to do it and also when I set password to my access database I am not able to access it by my my code. What property I have to set for same in my code.
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of colr__
colr__

No, there are no APIs or this. DSN is a windows thing, so you won't find it in cross-platform java. I had a look to see if you can do it from the command line, and it doesnt look like that option is available to you either (otherwise you could execute the command from java).

The password you your database is specified in the connection string you would be using. There are some examples here:

http://www.connectionstrings.com/access