About MS Access and JDBC

Discussions

EJB programming & troubleshooting: About MS Access and JDBC

  1. About MS Access and JDBC (1 messages)

    Hi I'm from Argentina, so sorry for my english...

    I want to know, haw to connect to an access database...
    Some sample code...

    Thanks.

    Bye.
  2. Hi Matias

    Firstly, u have to create a datasource name for the acess database u created. This can be done by going to the odbc connectivity and create a dsn for access database.

    U can use the jdbc odbc bridge driver which comes with the jdk.

    the sample

    Connection dbCon;

    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    dbCon = DriverManager.getConnection("jdbc:odbc:Mark");
    } catch(Exception e) {
    e.printStackTrace();
    }
    Here "Mark" is the datasource for the particular database.

    I think this would help u a lot
    for any further clarification contact
    easwaran2180@hotmail.com