0

I'm unable to connect to a local SQL Server with jdbc. This server is authenticated by Windows Authentication. One thing to mention is that I successfully connected to a remote SQL Server with SQL Server Authentication.

enter image description here

My code:

String url = "jdbc:sqlserver://localhost\\SQLEXPRESS;integratedSecurity=true;databaseName=TP3S;";
String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
Connection conn = DriverManager.getConnection(url);

I have enabled TCP/IP:

enter image description here

Any ideas? Thanks!

--UPDATE--

I have just started SQL Server Browser, now I'm getting the error:

WARNING: Failed to load the sqljdbc_auth.dll cause : no sqljdbc_auth in java.library.path
com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication.

--UPDATE--

I solved the previous problem by adding -Djava.library.path="DLL path" in Run->Run configuration->Apache Tomcat->Arguments. But now I'm getting this error:

com.microsoft.sqlserver.jdbc.SQLServerException: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
ethanjyx
  • 1,970
  • 7
  • 28
  • 50

1 Answers1

1

Under TCP/IP you can enable by IP address. Check if IPs are enabled.

  • I have 15 IP Addresses under TCP/IP, and none of them are enabled! How do I know which one I should enable? – ethanjyx Aug 24 '13 at 22:29