I want to connect to a SQL server using windows username and password through Java eclipse
Able to connect with Integrated Security = true .
But need try with other domains.
connecting with the below connection URL.
"jdbc:sqlserver://servername;databaseName=database;integratedSecurity=true"
Jar - MsSQL-jdbc-7.2.2.jre8.jar
failed with this URL
"jdbc:sqlserver://servername;databaseName=database;user=domain\user;password=password"
Error Message
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'domain\User'. ClientConnectionId:df0fd280-7727-446f-96e4-ce972fda26d7 at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262) at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:258) at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:104) at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:5036) at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:3668) at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:94) at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:3627) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7194) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2935) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:2456) at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2103) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1950) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1162) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:735) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at sql.Javaconnection.main(Javaconnection.java:27)