You need to setup a System DSN (Data Source Name) using your ODBC manager. You
can have your Access database in any subdirectory. Just specify the location of
your Access database in the System DSN. After you are done with this you can use
ODBC-JDBC bridge to access this database from your servlets or Java application.

Following code segment can be used to accomplish this:

        try {
            Class.forName(sun.jdbc.odbc.JdbcOdbcDriver);
            connection =
DriverManager.getConnection(jdbc:odbc:your-database-DSN, username, password);
            statement = connection.createStatement();
        }
        catch (ClassNotFoundException ex) {
            System.err.println("Cannot find the database driver classes.");
            System.err.println(ex);
        }
        catch (SQLException ex) {
            System.err.println("Cannot connect to this database.");
            System.err.println(ex);
        }

Hope this helps.

Jaideep

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to