java.sql.SQLException: Login failed for user 'sa' I am having trouble connecting to my SQL Server database through a jtds connection:

Connection conn = DriverManager.getConnection("jdbc:jtds:sqlserver://localhost:1433/MnA;instance=SQLEXPRESS", "sa","");


SQL Server is enabled, TCP/IP is enabled, Mixed server authentication is enabled

Any ideas?









java.sql.SQLException: Login failed for user 'sa'.
    at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
    at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)
    at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258)
    at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:603)
    at net.sourceforge.jtds.jdbc.ConnectionJDBC2.(ConnectionJDBC2.java:345)
    at net.sourceforge.jtds.jdbc.ConnectionJDBC3.(ConnectionJDBC3.java:50)
    at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at DB.dbConnect(testConnection.java:17)
    at testConnection.main(testConnection.java:7)
Make sure your jdts jar version is 1.2x. If it is not ,download correct version. And the second option is using JDBC jar for connecting MSSQL database.