Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/368.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java mssql jdbc始终抛出authenticationScheme NTLM无效 newsqlserverdriver(); String connectionUrl=“jdbc:sqlserver://;integratedSecurity=true;authenticationScheme=NTLM;domain=;user=;password=;”; try(Connection con=DriverManager.getConnection(connectionUrl);语句stmt=con.createStatement()){ String SQL=“从sys.dm_exec_连接中选择身份验证方案,其中session_id=@@spid”; 结果集rs=stmt.executeQuery(SQL); while(rs.next()){ System.out.println(rs.getString(1)); } }_Java_Sql Server_Jdbc_Ntlm - Fatal编程技术网

Java mssql jdbc始终抛出authenticationScheme NTLM无效 newsqlserverdriver(); String connectionUrl=“jdbc:sqlserver://;integratedSecurity=true;authenticationScheme=NTLM;domain=;user=;password=;”; try(Connection con=DriverManager.getConnection(connectionUrl);语句stmt=con.createStatement()){ String SQL=“从sys.dm_exec_连接中选择身份验证方案,其中session_id=@@spid”; 结果集rs=stmt.executeQuery(SQL); while(rs.next()){ System.out.println(rs.getString(1)); } }

Java mssql jdbc始终抛出authenticationScheme NTLM无效 newsqlserverdriver(); String connectionUrl=“jdbc:sqlserver://;integratedSecurity=true;authenticationScheme=NTLM;domain=;user=;password=;”; try(Connection con=DriverManager.getConnection(connectionUrl);语句stmt=con.createStatement()){ String SQL=“从sys.dm_exec_连接中选择身份验证方案,其中session_id=@@spid”; 结果集rs=stmt.executeQuery(SQL); while(rs.next()){ System.out.println(rs.getString(1)); } },java,sql-server,jdbc,ntlm,Java,Sql Server,Jdbc,Ntlm,以下是我的操作系统和Java版本: 操作系统:Windows 10 openjdk版本“1.8.0_242” OpenJDK运行时环境(build 1.8.0_242-b08) OpenJDK 64位服务器虚拟机(构建25.242-b08,混合模式) 不管字符串是“NTLM”还是“NTLM”等,此消息: authenticationScheme“”无效 这绝对是失败的 我也面临同样的问题。通过使用最新的jdbc驱动程序版本mssql-jdbc-9.2.0.jre8.jar解决了这个问题。另外,请

以下是我的操作系统和Java版本:

操作系统:Windows 10
openjdk版本“1.8.0_242”
OpenJDK运行时环境(build 1.8.0_242-b08)
OpenJDK 64位服务器虚拟机(构建25.242-b08,混合模式)

不管字符串是“NTLM”还是“NTLM”等,此消息:

authenticationScheme“”无效

这绝对是失败的
我也面临同样的问题。通过使用最新的jdbc驱动程序版本
mssql-jdbc-9.2.0.jre8.jar
解决了这个问题。另外,请确保将dll文件
mssql-jdbc_auth-9.2.0.x64.dll
放在lib path中。

对不起,我发现复制错误的唯一方法是添加
;authenticationScheme=\“\”
到连接字符串的末尾。但是,我注意到问题标题中的错误消息与问题正文中的错误消息不同,如果在文本
NTLM
中包含Unicode零宽度空格(
\u200b
),我可以重现该错误。这可能是你的问题吗?
new SQLServerDriver();
String connectionUrl = "jdbc:sqlserver://<server>;integratedSecurity=true;authenticationScheme=NTLM;domain=<MYDOMAIN>;user=<user>;password=<password>;";
try (Connection con = DriverManager.getConnection(connectionUrl); Statement stmt = con.createStatement()) {
    String SQL = "select auth_scheme from sys.dm_exec_connections where session_id=@@spid";
    ResultSet rs = stmt.executeQuery(SQL);
    while (rs.next()) {
        System.out.println(rs.getString(1));
    }
}