I tried to create a new connection to MSSQL server, for “DataSource Class” i entered “com.microsoft.sqlserver.jdbc.SQLServerDriver”, when click on “Test connection” i got the below error
Error messages / full error message screenshot / log file:
Error encountered
[ART.118.5011] Adapter Runtime (Connection): Unable to create new connection connection:sqlServerConn. [ADA.1.204] Cannot connect to the database with DataSource class “com.microsoft.sqlserver.jdbc.SQLServerDriver”. class com.microsoft.sqlserver.jdbc.SQLServerDriver cannot be cast to class javax.sql.DataSource (com.microsoft.sqlserver.jdbc.SQLServerDriver is in unnamed module of loader com.wm.app.b2b.server.PackageClassLoader @12792b88; javax.sql.DataSource is in module java.sql of loader ‘platform’)
Question related to a free trial, or to a production (customer) instance?
the mentioned class does not implement the DataSource interface and therefore cannot be used with the JDBC Adapter. There should be a corresponding DataSource implementation in the driver jar.
Change your connection config to this DataSource class and test again.
After that you should be able to use your connection.
you are right, but this does not seem to be issue here as the driver version 12.8 ist the latest and recommended one. Even the java version is out of scope here as the jre8 jar is the correct one for Java 8.
More likely it relates to wrong usage of the Driver class instead of the DataSource class, what I have already mentioned in my previous post.
Hi Holger,
Thanks for your reply,
I changed the “DataSource Class” to “com.microsoft.sqlserver.jdbc.SQLServerDataSource”, and the connection worked successfully