Error causing code:
...
DatabaseMetaData md = c.getMetaData();
rs = md.getSchemas();
// rs.next() throws an exception in second loop
while (rs.next()) {
System.out.println(rs.getString(1));
}
...
Stack:
Exception in thread "main" java.sql.SQLException: TDS Protocol error: Invalid packet type 0x64
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2318)
at net.sourceforge.jtds.jdbc.TdsCore.getNextRow(TdsCore.java:765)
at net.sourceforge.jtds.jdbc.JtdsResultSet.next(JtdsResultSet.java:596)
at test.sybase.jtds.TestSybaseJtds.runTest(TestSybaseJtds.java:58)
at test.sybase.jtds.TestSybaseJtds.main(TestSybaseJtds.java:69)
Caused by: net.sourceforge.jtds.jdbc.ProtocolException: Invalid packet type 0x64
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2305)
... 4 more
Connection then gets into the closed state (connection.isClosed() == true) so it's no longer usable.
Server/Driver info as reported by dbMetaData:
DB product: SQL Anywhere
DB product version: 11.0
Driver version: 1.2.4
Currently, the jTDS driver doesn't support the Sybase ASA server family. If you are really brave you could try compiling jTDS from CVS HEAD. That version has experimental ASA support. If you are looking for a production ready driver you should stick with jConnect.
Hope that helps,
momo