How to connect to Access .mdb database from 64-bit Java?

前端 未结 3 1549
故里飘歌
故里飘歌 2020-12-04 00:34

Hi I have the below code to connect to MS Access database on Windows 7 OS. I have changed the Data Source short cut to point to 64bit odbc then 32 bit. But still getting the

3条回答
  •  囚心锁ツ
    2020-12-04 01:25

    1) you will have to configure System dsn (Driver Microsoft Access Driver(.mdb,.accdb)) 2) link .mdb database in above configuration and write below code.

     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
     String database = "jdbc:odbc:systemdsnname";
     Connection conn = DriverManager.getConnection(database, "", "");
    

提交回复
热议问题