Re: Client "Host not found"

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



The ping command was ran from a command line, PING 'x.x.x.x'.

Here is the java code:
--------------------------------------------------------------------------------------------
import java.sql.*;

public class Jdbc {
public static void main (String args[]) throws Exception {
try {
java.lang.Class.forName
("com.microsoft.sqlserver.jdbc.SQLServerDriver");

Connection c = java.sql.DriverManager.getConnection
("jdbc:sqlserver://x.x.x.x;user=Anonymous;password=guest;");

System.out.println("Connected");
}
catch (SQLException se) {
do {
System.out.println("SQL STATE: " + se.getSQLState());
System.out.println("ERROR CODE: " + se.getErrorCode());
System.out.println("MESSAGE: " + se.getMessage());
System.out.println();
se = se.getNextException();
} while (se != null);

se.printStackTrace();
}
}
}
--------------------------------------------------------------------------------------------
And the stack trace.

java.lang.NullPointerException

at java.lang.Throwable.<init>(Throwable.java:180)

at java.lang.Exception.<init>(Exception.java:29)

at java.lang.RuntimeException.<init>(RuntimeException.java:32)

at
java.lang.NullPointerException.<init>(NullPointerException.java:36)
at Jdbc.main(Jdbc.java:6)

.