此驱动程序未配置为集成身份验证 [英] This driver is not configured for integrated authentication
问题描述
尝试使用 sqljdbc41
为 jdk 1.8
连接我的Java web应用程序与MS-SQL服务器。这里是数据库连接代码 -
连接连接;
String url =jdbc:sqlserver:// localhost:1433; databaseName = Lista; integratedSecurity = true;
Class.forName(com.microsoft.sqlserver.jdbc.SQLServerDriver);
connection = DriverManager.getConnection(url);
当我尝试向数据库中插入一些值时 -
PreparedStatement ps = connection.prepareStatement(INSERT INTO user_informations VALUES(?,?,?));
ps.setString(1,value);
ps.setString(2,value);
ps.setString(3,value);
ps.executeUpdate();
每次获得以下错误 -
com.microsoft.sqlserver.jdbc.SQLServerException:此驱动程序不是为
配置的集成身份验证
- 我添加了
sqljdbc41
在路径变量中。 - 我在路径变量中添加了
sqljdbc_auth.dll
的路径。 / li>
- 我已将
sqljdbc41.jar
添加到我的Nebeans
项目库中。 - 我已将
sqljdbc_auth.dll
添加到jdk
下的bin文件夹以及jre
。 - 我的
jdk
是64位
在程序文件文件夹下,而不是在程序文件(x86)中。 - jdbc驱动程序文件夹也位于程序文件目录中。 > sql server和sql server浏览器服务也在运行。
- i have added the path of
sqljdbc41
in the path variable. - i have added the path of
sqljdbc_auth.dll
in the path variable. - i have added the
sqljdbc41.jar
into myNebeans
project library. - i have added the
sqljdbc_auth.dll
into both bin folder underjdk
andjre
. - my
jdk
is64 bit
under program files folder not in program file(x86). - jdbc driver folder is also in program file directory.
- sql server and sql server browser services are also running.
编辑
现在我遇到了一件新事物 - 我的电脑,当我第一次部署项目,那么它是完美的工作,但是当我在我的代码做任何改变,并重新运行项目它不工作!
我解决了我的问题!
这个错误(在我上面的问题中描述过) glassfish 服务器在 sqljdbc42.jar
文件中没有任何访问权限。所以我已将 sqljdbc42.jar
文件放入我位于此位置的 glassfish
服务器中 -
glassfish-4.1 \glassfish\domains\domain1\lib
现在它正在运行。
谢谢大家!
Trying to connect my java web application with MS-SQL server using sqljdbc41
for jdk 1.8
. Here is the database connection code-
Connection connection;
String url = "jdbc:sqlserver://localhost:1433;databaseName=Lista;integratedSecurity=true";
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
connection = DriverManager.getConnection(url);
when i am trying to insert some values to the database like-
PreparedStatement ps = connection.prepareStatement("INSERT INTO user_informations VALUES(?,?,?)");
ps.setString(1, "value");
ps.setString(2, "value");
ps.setString(3, "value");
ps.executeUpdate();
getting the following error each time-
com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication
Here are some informations about what i have tried yet-
Edit
Now i experiencing a new thing-after restarting my pc when i deploy the project for the first time then it is working perfectly but when i make any change in my code and re-run the project it's not working!
I solved my problem!
The error (described in my question above) i was getting because the glassfish
server had not any access on sqljdbc42.jar
file. so i have placed the sqljdbc42.jar
file into my glassfish
server in this location-
glassfish-4.1\glassfish\domains\domain1\lib
And it's now working perfectly.
Thank you everyone!
这篇关于此驱动程序未配置为集成身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!