I have been struggling since morning in order to try to connect my java web application to the database which is on a different system (using windows auth).
I managed to access it from my SSMS, I went to windows credentials manager and created the same credentials as of other system where the SQL server is installed, below are the details:
Now when I use the IP(192.168.2.172) in SSMS as a server name then I am able to connect using windows auth but can not access the same from my Java web app. I am using jtds with the below string but its not working. Please help
<property name="url" value="jdbc:jtds:sqlserver://192.168.2.172:1433/realtime;useNTLMv2=true" />
I am constantly getting this error:
Caused by: java.sql.SQLException: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:649)
at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(JtdsConnection.java:371)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.commons.dbcp.BasicDataSource.valida