Thread: Setting the DSN
View Single Post
  #2 (permalink)  
Old 02-14-2008, 10:55 PM
jelly's Avatar
jelly jelly is offline
Member
 
Join Date: Jan 2008
Location: Somerset, UK
Posts: 46
jelly is on a distinguished road
Hi Tim, just in case you never found the answer to this. Strictly speaking you cannot set the DSN from Java but what you can do is make a JDBC connect without a DSN, usually referred to as a DSNless connection. In this case you specify from code the details that you would have put in th eDSN, e.g.

Code:
String connectionString = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/dbs/salaries.MDB"; DBConn = DriverManager.getConnection(connectionString);
Masses on the net under dsnless connections if you need more
__________________
-- Hope that helps
Reply With Quote