How can I connect to SQL Server using integrated security with the JDBC driver?

前端 未结 1 1962
[愿得一人]
[愿得一人] 2020-12-17 18:35

I\'m trying to connect to my company\'s SQL server using Microsoft\'s JDBC driver for SQL Server 2005. This is what my connection string looks like:

jdbc:sql         


        
相关标签:
1条回答
  • 2020-12-17 19:28

    Check these instructions, also - are you on the same domain (caller and server?)

    Quoting from there:

    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.

    The sqljdbc_auth.dll files are installed in the following location:

    <installation directory>\sqljdbc_<version>\<language>\auth\
    

    Note:

    If you are running a 32-bit Java Virtual Machine (JVM), use the sqljdbc_auth.dll file in the x86 folder, even if the operating system is the x64 version. If you are running a 64-bit JVM on a x64 processor, use the sqljdbc_auth.dll file in the x64 folder. If you are running a 64-bit JVM on a IA-64 processor, use the sqljdbc_auth.dll file in the IA64 folder.

    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:\Microsoft SQL Server 2005 JDBC Driver\sqljdbc_<version>\enu\auth\x86
    
    0 讨论(0)
提交回复
热议问题