sqljdbc4 2 on Glassfish server4 1

孤者浪人 提交于 2019-12-12 00:10:00

问题


I am running my java web application on glassfish server v4.1 in netbeans v8.0.2, using sqljdbc42 and this 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 open my ide and run my project for the first time the glassfish server starts automatically since my project's server is glassfish, and i can perform any crud operation with my Ms-Sql server2012.

But the problem starts when i make changes in any file keeping the server on and run the project again and try to perform any crud operation i get this following error-

com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication

But if i stop the server before changing any file and start after changing and run the project then it works without any error.

Stopping and re-starting the server again and again taking so many times from my total project time! Any help or suggestion will be appreciated.

Thank You.


回答1:


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!



来源:https://stackoverflow.com/questions/32558251/sqljdbc4-2-on-glassfish-server4-1

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