But there must be a difference, because in the same project, with the same settings, the same classpath, this code works:
public final void testConnection() {
Connection con = null;
PreparedStatement pstmt = null;
ResultSet res = null;
String statement = "select * from Table1";
try {
Class.forName("net.sourceforge.jtds.jdbc.Driver");
con = DriverManager.getConnection("jdbc:jtds:sqlserver://dbserver.xyz.uvw.de:1433/DATABASENAME", "my_username", "my_password");
pstmt = con.prepareStatement(statement);
res = pstmt.executeQuery();
while (res.next()) {
System.out.println(counter + ": " + res.getObject(1));
}
...
[Message sent by forum member 'jiai' (jiai)]
http://forums.java.net/jive/thread.jspa?messageID=293282