JDBC DatabaseMetaData method not implemented by JDBC(T4SQLMX) driver

3.5k Views Asked by At

I am setting up a Spring-boot application to connect to HP NonStop Tandem's SQL/MX. First I achieved this connection by hard-coding the jdbc parameters like dataSource, URL, etc in the service section of the application and it worked (I was able to access tables by executing query).

Now I am trying to remove the hard coded part and have my database related info in application.properties file, but now I am getting the following error

org.springframework.jdbc.support.MetaDataAccessException: JDBC DatabaseMetaData method not implemented by JDBC driver - upgrade your driver; nested exception is java.lang.AbstractMethodError: Method com/tandem/t4jdbc/SQLMXConnection.isValid(I)Z is abstract

Can someone help me understand the root cause? The same driver jar is being used when hard-coding the datasource details and it worked but not working when having the data source properties in application.properties and needs an upgrade to the jar.

2

There are 2 best solutions below

0
On

I encountered the same exception when using Spring Data JPA in a Spring Boot application, the JTDS driver and the Hikari connection pool. In my case I discovered that the following fixed the problem:

Examining the class com.zaxxer.hikari.pool.PoolBase, the following can be observed:

this.isUseJdbc4Validation = config.getConnectionTestQuery() == null;

Thus JDBC 4 validation will not be attempted if there is a connection test query configured. In a Spring Boot application, this can be accomplished like this:

spring.datasource.hikari.connection-test-query=select 1;

Regretfully I do not have any experience with the T4SQLMX driver but nevertheless hope this can be of some use.

1
On

I recently fought through the same issue, for me I was using a JDBC type 3 driver; but my spring implementation only supported a type 4 driver, thus when the method you linked above was attempted to be called, it caused the error.

I suggest you look for a type 4 driver for your particular database and see if that resolves your issue.