JDBC with ms-access?

后端 未结 4 879
梦如初夏
梦如初夏 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:19

    To connect Java with MS Access, you need a JDBC driver. I still don't think Microsoft do one do they! http://www.easysoft.com/applications/microsoft-access/jdbc-odbc.html

    0 讨论(0)
  • 2020-12-20 09:22

    I recommend a cross-platform Access JDBC driver called UCanAccess. It works great and there are lots of examples on the site (to help the original poster.)

    0 讨论(0)
  • 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
    
    0 讨论(0)
  • 2020-12-20 09:39

    JDBC/ODBC driver is a platform dependent and can be used only in Windows OS. Also, there are some platform independent JDBC drivers, for example: StelsMDB JDBC driver (http://www.csv-jdbc.com/stels_mdb_jdbc.htm)

    0 讨论(0)
提交回复
热议问题