I want to connect to ExaSol database using Scala. I'm able to connect to the database in Python using pyodbc but I'm receiving the following error on attempting to connect using JDBC driver in Scala :
scala> :require /Users/some/path/mssql-jdbc-7.4.0.jre8.jar
scala> Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver")
scala> import java.sql.{Connection, DriverManager, ResultSet}
scala> val conn = DriverManager.getConnection("jdbc:sqlserver://11.11.11.11:8563;databaseName=some-db;user=user_name;password=pass_word;useUnicode=true;characterEncoding=UTF-8")
Sep 11, 2019 1:38:55 PM com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin
WARNING: ConnectionID:2 ClientConnectionId: a03dede8-7f9c-495d-83d5-4986b859e1e9 Prelogin error: host 11.11.11.11 port 8563 Unexpected end of prelogin response after 0 bytes read
Sep 11, 2019 1:38:55 PM com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin
WARNING: ConnectionID:2 ClientConnectionId: ea705538-c0c9-4bc3-ba66-9630e7850b58 Prelogin error: host 11.11.11.11 port 8563 Unexpected end of prelogin response after 0 bytes read
Sep 11, 2019 1:39:09 PM com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin
WARNING: ConnectionID:2 ClientConnectionId: 5238ac7c-55cc-4ec2-a070-d7f454c6c43b Prelogin error: host 11.11.11.11 port 8563 Unexpected end of prelogin response after 0 bytes read
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 11.11.11.11, port 8563 has failed. Error: "The driver received an unexpected pre-login response. Verify the connection properties and check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. This driver can be used only with SQL Server 2005 or later.". ClientConnectionId:5238ac7c-55cc-4ec2-a070-d7f454c6c43b
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:2924)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:2913)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.Prelogin(SQLServerConnection.java:2655)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:2480)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2142)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1993)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1164)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:760)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:270)
... 28 elided
Please try to use the "com.exasol.jdbc.EXADriver" driver.
The documentation is in the below url: