Here you can find the source of getAccessConn(String path)
public static Connection getAccessConn(String path)
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class Main { public static Connection getAccessConn(String path) { try {//from w w w . j a v a 2 s.co m Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url = "jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=" + path; return DriverManager.getConnection(url, "", ""); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } catch (SQLException ex) { ex.printStackTrace(); } return null; } }