Support JTDS driver
The JTDS driver for SQL Server is not currently supported with Babelfish. When connecting to the Babelfish endpoint an error is raised:
Spring boot versions: 1.4.0 and 2.6.1 Java Version: 8 SQL Server JDBC drivers: MSSQL JDBC 6 and 9, JTDS 1.3.1
2022-05-31 15:12:13.025 [main] [INFO ] DividendApiApplication - Started DividendApiApplication in 46.102 seconds (JVM running for 50.844)
2022-05-31 15:13:13.288 [SimpleAsyncTaskExecutor-10] [ERROR] ConnectionPool - Unable to create initial connections of pool.
java.sql.SQLException: I/O Error: DB server closed connection.
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2481)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:632)
at net.sourceforge.jtds.jdbc.JtdsConnection.
This has also been reported on GitHub: https://github.com/babelfish-for-postgresql/babelfish_extensions/issues/593
Investigation so far:
- With Babelfish, LOGIN packet is sent directly instead of PRELOGIN packet (for SSL 'ON' and 'OFF')
- With SQL Server, connection is made with SSL 'OFF' even with LOGIN packet send first. But with SLL 'ON', there is request and response from client and server but after that the client is timing out.
We have a case similar to this comment - there is one service that uses JTDS and it is cumbersome to update it to use mssql-jdbc. After looking into JTDS problems with Babelfish it seems that it can be supported with a relatively minor change. I've filed PR #2320 with a patch.