ClassNotFoundException when trying to connect to .accdb file via JDBC-ODBC in Java 8

前端 未结 4 2020
猫巷女王i
猫巷女王i 2020-12-11 09:16

I\'m working in a project in Java in Eclipse EE IDE where I have to query a .accdb file. The problem is when I try to load the driver and then connect to the d

相关标签:
4条回答
  • 2020-12-11 09:47

    According to this post the JDBC-ODBC Bridge was removed in Java8. You can use a JDBC Driver specifically for Access. I see a lot of people mentioning UCanAccess to connect to Access although I have not used it myself.

    0 讨论(0)
  • 2020-12-11 09:48

    ODBC Bridge might not exist in JRE rather than SUN's. Check your JRE.

    0 讨论(0)
  • 2020-12-11 09:52

    According to Oracle the JDBC-ODBC Bridge will no longer be included with JDK as of Java SE 8 and that

    The ideal is "Pure Java": no native code, no platform dependent features.

    that means looking for at least a JDBC type 3 or 4.

    Lance Andersen wrote:

    The JDBC-ODBC Bridge has always been considered transitional and a non-supported product that was only provided with select JDK bundles and not included with the JRE.

    The JDBC-ODBC bridge provides limited support for JDBC 2.0 and does not support more recent versions of the JDBC specification.

    You should either use any of third-part database drivers (as Microsoft doesn't provide for any) or use a previous version of java. Anyhow I suggest using a specific Driver, instead of the JDBC-ODBC one.

    For that you could look at any of the following:

    • EasySoft drivers
    • UCanAccess
    0 讨论(0)
  • 2020-12-11 09:53

    Oracle's (and Sun's) official position has long (since JDBC 1.0!) been that --

    the [JVM-bundled] JDBC-ODBC Bridge should be considered a transitional solution [...] Oracle [was Sun] does not support the JDBC-ODBC Bridge.

    However, my employer, OpenLink Software, has produced enterprise-grade commercial Type 1 Bridges between JDBC and ODBC since JVM 1.0, and current versions are fully compatible with the current JVM 1.8. You can learn more here --

    • Single-Tier JDBC-ODBC Bridge Driver -- a JDBC driver for ODBC data sources
    • Single-Tier ODBC-JDBC Bridge Driver -- an ODBC driver for JDBC data sources
    0 讨论(0)
提交回复
热议问题