You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Oracle SQL Developer 4.2通过Windows身份验证连接SQL Server失败求助

Troubleshooting Windows Authentication Failures with jTDS 1.3.1 in Oracle SQL Developer 4.2

Let’s walk through the most common fixes for this issue, since you’ve already tried placing the DLLs in standard locations and restarting:

  • Match DLL bitness to SQL Developer’s JRE
    Oracle SQL Developer 4.2 often ships with its own bundled JRE, which might be 32-bit even on a 64-bit system. Double-check the bitness of the JRE SQL Developer is using: go to Help > About and look for the "Java Version" entry. Make sure the ntlmauth.dll you’re using matches this bitness (32-bit DLL for 32-bit JRE, 64-bit for 64-bit JRE). Placing the wrong bitness DLL in any directory won’t work, even if you restart.

  • Place DLLs in SQL Developer’s bundled JRE directory
    If SQL Developer is using its own JRE (not your system JDK/JRE), the DLLs you placed in jdk/jre/bin or system folders won’t be picked up. Find the bundled JRE path from the About window (it might look like <sqldeveloper_install_dir>\jdk\jre), copy ntlmauth.dll into its bin subfolder, then restart SQL Developer.

  • Verify your connection configuration
    Ensure your SQL Developer connection is set up correctly for Windows Auth with jTDS:

    1. When creating a new MS SQL connection, select jTDS as the driver.
    2. Check the box for Use Windows Authentication.
    3. If you’re on a domain, add the domain parameter to your connection string (or fill the Domain field in the connection UI). You can also try adding useNTLMv2=true to the connection properties to force newer NTLM authentication, which is often required for modern Windows domains.
      Example connection string:
    jdbc:jtds:sqlserver://<your_server>:1433/<your_database>;domain=<your_domain>;useNTLMv2=true
    
  • Test DLL loading with a simple Java program
    To confirm if the DLL is being loaded correctly, create a quick test program using the same JRE that SQL Developer uses. Compile and run it to see if you get a clear error message (like UnsatisfiedLinkError if the DLL is missing or mismatched):

    import java.sql.Connection;
    import java.sql.DriverManager;
    
    public class JtdsAuthTest {
        public static void main(String[] args) {
            try {
                Class.forName("net.sourceforge.jtds.jdbc.Driver");
                Connection conn = DriverManager.getConnection(
                    "jdbc:jtds:sqlserver://your_server:1433/your_db;domain=your_domain;useNTLMv2=true"
                );
                System.out.println("Connection successful!");
                conn.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    

    Run this with the JRE from SQL Developer (e.g., <sqldeveloper_jre_path>\bin\java.exe JtdsAuthTest). The error output will point you directly to whether the DLL issue is the root cause.

  • Check SQL Server settings
    Make sure SQL Server is configured to allow Windows Authentication (open SQL Server Management Studio, go to Server Properties > Security > Server authentication, confirm "Windows Authentication mode" is selected). Also, verify that your Windows user has permissions to access the target database, and that the SQL Server TCP/IP protocol is enabled (in SQL Server Configuration Manager).

内容的提问来源于stack exchange,提问作者Athar Iqbal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 08:29:35