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-
sqljdbc41
in the path variable.sqljdbc_auth.dll
in the path variable.sqljdbc41.jar
into my Nebeans
project library.sqljdbc_auth.dll
into both bin folder under jdk
and jre
.jdk
is 64 bit
under program files folder not in program file(x86).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!
SQLServerException: This driver is not configured for integrated authentication. This generally indicates that the driver can not find the appropriate sqljdbc_auth. dll in the JVM library path. To correct the problem, please use the java.exe -D option to specify the "java.
To configure SQL Server for Windows integrated securityRight-click the Users node and select New Database User. In the Database User Properties dialog box, enter domain\username in the Login name box, and then click OK. Additionally, configure the SQL Server to allow all domain users to access the database.
After downloading, you can find the sqljdbc_auth. dll in the auth folder of the downloaded file. Place this sqljdbc_auth. dll in this location C:\Windows\System32, and stop and start the Data Integration platform service using Syncfusion Data Integration manager.
sqljdbc_auth.dll
is need to use windows authentication or Kerberos authentication.
Get the dll from Microsoft and install it either by:
drop the library on some folder and then add the path in the command line:
java -Djava.library.path=<library path>...
The mssql-jdbc driver and the auth dll should be:
Check also the jdbc compatibility matrix with java versions on the download page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With