JDBC driver MS Access connection

后端 未结 9 1864
执念已碎
执念已碎 2020-12-09 06:10

I want connect my MS access file with Java GUI program,but I have problem with connection....

I have Windows 7 64b, and ms office 2007. When I opened the ODBC driver

9条回答
  •  春和景丽
    2020-12-09 06:53

    final String fileName = "c:/myDataBase.mdb"
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="+fileName;
    Connection con = DriverManager.getConnection(url,username,password);
    

提交回复
热议问题