This driver is not configured for integrated authentication
Asked Answered
T

3

5

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-

  • 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 my Nebeans project library.
  • i have added the sqljdbc_auth.dll into both bin folder under jdk and jre.
  • my jdk is 64 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.

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!

Tripping answered 12/9, 2015 at 8:5 Comment(4)
Look at this link: JDBC 4.x: This driver is not configured for integrated authentication. ALSO: Are you running a 32-bit or 64-bit JVM? Exactly where did you get sqljdbc_auth.dll: from the 32-bit or 64-bit Windows folder?Resolution
i already saw this, but it wasn't helpful for me! i putted sqljdbc_auth.dll from program files directory. isn't it windows 64bit folder?Tripping
Have you looked at all the suggestions in https://mcmap.net/q/568167/-dll-missing-in-jdbc ?Exhortation
This answer help me #10638085Hooray
T
3

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!

Tripping answered 14/9, 2015 at 7:6 Comment(0)
R
4

sqljdbc_auth.dll is need to use windows authentication or Kerberos authentication.

Get the dll from Microsoft and install it either by:

  1. drop on application library folder
  2. drop on the java bin folder (attention if you have multiple java installations)
  3. 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:

  • on the same folder (but not mandatory)
  • both from the same version
  • for the same architecture (x86/x64) JVM is running.

Check also the jdbc compatibility matrix with java versions on the download page.

Relaxation answered 14/12, 2019 at 0:23 Comment(0)
T
3

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!

Tripping answered 14/9, 2015 at 7:6 Comment(0)
P
0

The problem for me was that there were 2 java installations, one of them was the standard installation and it was 64bit, the other one was included in my oracle jdeveoper installation (it was the one used by the application giving that error) and surprisingly it was 32bit. I just put the correct dll in the java installation used by my application and everything went well

Primogenitor answered 2/8, 2017 at 7:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.