sun.jdbc.odbc.JdbcOdbcDriver not working with jdk 1.8

佐手、 提交于 2019-12-18 09:41:16

问题


I downloaded jdk8u40 and now I get:

SQLException:
SQLState: 08001
Message:  No suitable driver found for jdbc:odbc:mysqlDB
Vendor:   0

where mysqlDB is my data source name.

I use:

jdbc.drivers=sun.jdbc.odbc.JdbcOdbcDriver
jdbc.url=jdbc:odbc:mysqlDB

as connection strings. I have downloaded and installed driver:

mysql-connector-odbc-5.3.4-winx64.msi

I read in your forums that the jdbc-odbc bridge is no longer supported in jdk 1.8. Any help appreciated.


回答1:


The JDBC-ODBC bridge is no longer shipped/supported with JDK 8, hence the errors:

The JDBC-ODBC Bridge should be considered a transitional solution; it will be removed in JDK 8. In addition, Oracle does not support the JDBC-ODBC Bridge. Oracle recommends that you use JDBC drivers provided by the vendor of your database instead of the JDBC-ODBC Bridge.

If you're using Java, it would be better to use a JDBC driver instead of an ODBC driver, see here http://dev.mysql.com/downloads/connector/j/ for the MySQL JDBC driver.




回答2:


In regards to the comment "I read in your forums that the jdbc-odbc bridge is no longer supported in jdk 1.8. Any help appreciated."

Please note that can obtain JDBC-ODBC Type 1 Bridge Drivers from third parties. For example, OpenLink Software continues to provide an JDBC-ODBC Bridge Driver for past and current Java Virtual Machine editions:

  1. Single-Tier JDBC-ODBC Bridge Driver
  2. Single-Tier ODBC-JDBC Bridge Driver


来源:https://stackoverflow.com/questions/29356855/sun-jdbc-odbc-jdbcodbcdriver-not-working-with-jdk-1-8

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!