java 1.7 与 jdbc 驱动程序的兼容性

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26661854/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 10:20:46  来源:igfitidea点击:

java 1.7 compatibility with jdbc driver

javasql-server-2008jdbc

提问by vbNewbie

I am new user with java and finally got my code to work and tried transporting it to a remote machine as a jar to run and started getting the following error:

我是 java 的新用户,终于让我的代码工作并尝试将它作为 jar 传输到远程机器上运行并开始收到以下错误:

com.microsoft.sqlserver.jdbc.SQLServerConnection <init> SEVERE: Java Runtime Environment 
(JRE) version 1.8 is not supported by this driver. Use the sqljdbc4.jar class library, 
which provides support for JDBC 4.0.java.lang.UnsupportedOperationException: 
Java Runtime Environment (JRE) version 1.8 is not supported by this driver. Use 
 the sqljdbc4.jar class library, which provides support for JDBC 4.0.
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.<init>
    (SQLServerConn

I updated the driver in the build path and still does not work. It runs fine on my desktop so not sure what the issue is. Please advise as to what is the best approach here.

我更新了构建路径中的驱动程序,但仍然无法正常工作。它在我的桌面上运行良好,所以不确定是什么问题。请告知这里最好的方法是什么。

EDIT:

编辑:

The snapshot I posted above shows 1.8 but i have tried it on several 1.7 machine versions.

我上面发布的快照显示的是 1.8,但我已经在几个 1.7 机器版本上尝试过。

cJYJe.png

cJYJe.png

and also connection code

还有连接代码

    String dataConnectionUrl = "jdbc:sqlserver://192.xxx.x.xxx:1433;" +
             "databaseName=clientsDB;user=me;password=notyou";

采纳答案by Gord Thompson

Microsoft JDBC Driver 4.0 for SQL Server (sqljdbc4.jar), available via the download link on the page here, is indeed compatible with both JRE 7 and JRE 8. I just confirmed Java 8 compatibility on an Xubuntu 14.04 box with

Microsoft JDBC Driver 4.0 for SQL Server (sqljdbc4.jar),可通过此处页面上的下载链接获得,确实与 JRE 7 和 JRE 8 兼容。我刚刚确认了 Xubuntu 14.04 盒子上的 Java 8 兼容性

java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)