-
hikaripool-1 - failed to execute isvalid() for connection 에러 해결서버 & 프레임워크/Spring & SpringBoot 2025. 2. 17. 16:44
hikaripool-1 - failed to execute isvalid() for connection, configure connection test query (receiver class cohttp://m.ibm.as400.access.as400jdbcconnectionimpl does not define or inherit an implementation of the resolved method 'abstract boolean isvalid(int)' of interface java.sql.connection.).
현재 AS400 DB2를 사용하고있는데 Spring Boot 에서 Mybatis를 연동하는 중, 이 에러를 마주했다.
에러를 분석해보니 hikariCP에서는 isValid()라는 함수를 사용해서 유효성 검사를 하고 DB와 커넥션을 맺는다고 한다.
그런데 jt400 JDBC드라이버에는 isValid()함수가 구현이 안되어있는 것 같다. (jt400을 최신버전으로 바꿔도 안됨)이 에러를 해결하기위해서는 유효성 검사를 다른 방식으로 해주면 된다.
application.properties에
spring.datasource.hikari.connection-test-query: values 1
를 추가했더니 해결됐다.
유효성 검사를 ' values 1 '이라는 쿼리를 통해서 하는 것이다.
출처 : https://stackoverflow.com/questions/68120283/unable-to-connect-ibmi-machine-with-spring-data-jpa