Advertisement
Guest User

Untitled

a guest
Nov 26th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. import java.sql.Connection;
  2. import java.sql.DriverManager;
  3. import java.sql.SQLException;
  4.  
  5. public class Connect
  6. {
  7. public static void main(String[] args) throws Exception
  8. {
  9. String userName = "Abhishek";
  10. String password = "abhishek-nayak";
  11. String url = "jdbc:sqlserver://Abhishek-VAIO\MSSQLSERVER;databaseName=master;integratedSecurity=true";
  12. try
  13. {
  14. Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
  15. Connection conn = DriverManager.getConnection(url,userName,password);
  16. System.out.println("Connected");
  17. }
  18. catch(SQLException e)
  19. {
  20. e.printStackTrace();
  21. }
  22. }
  23. }
  24.  
  25. Sep 06, 2012 9:09:55 PM com.microsoft.sqlserver.jdbc.AuthenticationJNI <clinit>
  26. WARNING: Failed to load the sqljdbc_auth.dll cause : no sqljdbc_auth in java.library.path
  27. com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId:5cb4d70b-f644-4670-b7bc-a2312b8547b4
  28. at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1667)
  29. at com.microsoft.sqlserver.jdbc.AuthenticationJNI.<init>(AuthenticationJNI.java:60)
  30. at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:2229)
  31. at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:41)
  32. at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:2220)
  33. at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
  34. at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
  35. at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1326)
  36. at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:991)
  37. at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:827)
  38. at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1012)
  39. at java.sql.DriverManager.getConnection(Unknown Source)
  40. at java.sql.DriverManager.getConnection(Unknown Source)
  41. at com.abhishek.Connect.main(Connect.java:17)
  42. Caused by: java.lang.UnsatisfiedLinkError: no sqljdbc_auth in java.library.path
  43. at java.lang.ClassLoader.loadLibrary(Unknown Source)
  44. at java.lang.Runtime.loadLibrary0(Unknown Source)
  45. at java.lang.System.loadLibrary(Unknown Source)
  46. at com.microsoft.sqlserver.jdbc.AuthenticationJNI.<clinit>(AuthenticationJNI.java:35)
  47. ... 12 more
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement