This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
CODE for Java with MS Access
Posted by RajeshKanann on June 22, 2000 at 11:18 AM
If you decided to use the MS Access with JAVA , you should've to create the DSN in all the client's machine what are all supposed to use that application.
YOu can use the following code to connect to databse using Access in JAVA.
//////////////////// CODE STARTS HERE ////////////
public class DataBase
static String url = "jdbc:odbc:test" ; // test is the DSN
static String message;
static String query=null;
connection = DriverManager.getConnection(url);
message = "Exception during SQL query: " + ex.toString();
////////////// CODE ENDS HERE////////////////
After this just create the instance of this class and call the method.