SQLException: this driver is not configured for integrated authentication tomcat

后端 未结 2 1232
执笔经年
执笔经年 2020-12-07 02:05

Am trying to connect MS SQL server through java web applications.

Class.forName(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\");

connection= DriverManager         


        
相关标签:
2条回答
  • 2020-12-07 02:45

    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.

      Not recommended if you want to package the applications with all the dependencies. Also, it requires to find what java version is being used and from what path.

    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 sqljdbc_auth.dll should be:

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

    Check also the jdbc comparability matrix with java versions.

    0 讨论(0)
  • 2020-12-07 02:58

    The JDBC driver supports the use of Type 2 integrated authentication on Windows operating systems through the integratedSecurity connection string property. To use integrated authentication, copy the sqljdbc_auth.dll file to a directory on the Windows system path on the computer where the JDBC driver is installed.

    Alternatively you can set the java.libary.path system property to specify the directory of the sqljdbc_auth.dll. For example, if the JDBC driver is installed in the default directory, you can specify the location of the DLL by using the following virtual machine (VM) argument when the Java application is started:

    -Djava.library.path=c:/sqljdbc_<version>/enu/auth/x86
    

    or

    -Djava.library.path=c:/sqljdbc_<version>/enu/auth/x64
    

    Please read more about in the original documentation: https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-2017

    0 讨论(0)
提交回复
热议问题