日期:2014-05-20 浏览次数:20796 次
private static final String DBDRIVER = "sun.jdbc.odbc.JdbcOdbcDriver" ; private static final String DBURL = "jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=src\\dbc\\cytest.mdb" ; private static final String DBUSER = "" ; private static final String DBPASSWORD = "" ; private Connection conn = null ; public DatabaseConnection() throws Exception{ try{ Class.forName(DBDRIVER) ; this.conn = DriverManager.getConnection(DBURL, DBUSER, DBPASSWORD) ; }catch(Exception e){ e.printStackTrace() ; } }