JDBC with ms-access?

后端 未结 4 881
梦如初夏
梦如初夏 2020-12-20 09:07

How to connect to a Microsoft Access-based database in a Windows using JDBC code?

What syntax is to be written for Type-1 and Type-4 types of the drivers?

         


        
4条回答
  •  春和景丽
    2020-12-20 09:28

    You can use JDBC-ODBC bridge by calling:

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
    

    Then you can use JDBC database URL in form:

    jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\\Nwind.mdb
    

    or if you configure your database in ODBC manager you can use its alias:

    jdbc:odbc:northwind
    

提交回复
热议问题