We're using JT400 9.4 with Java7 and HikariCP connecting to the iSeries. Hikari supports the JDBC4 way of testing the validity of a connection with isValid, but JT400 doesn't seem to support it.
I thought the docs said it is compliant?
https://www-03.ibm.com/systems/power/software/i/toolbox/faq/jdbc.html#faqB1
The error on app start:
java.lang.AbstractMethodError: com.ibm.as400.access.AS400JDBCConnection.isValid(I)Z at com.zaxxer.hikari.pool.PoolBase.checkDriverSupport(PoolBase.java:411)
Or am I doing something wrong? Old JT400 docs say there is a JDBC4 JAR, but I don't see that in any recent ZIPs from Sourceforge.
Since that is a JDBC40 feature, you need to use the version of the jt400.jar file compiled for java6. It is in the lib/java6 directory of the zip file that you download.
unzip -l jtopen_9_4.zip | grep jt400.jar
4789388 01-11-18 23:17 lib/java6/jt400.jar
Thank you - that worked!
Any plans to support the JDBC 4.2 spec?
The JDBC 4.2 should be supported by the java8 version of jt400.jar
Is the java8 version available via Maven?
https://mvnrepository.com/artifact/net.sf.jt400/jt400-jdk8
Yes, you can find the latest version from http://repo1.maven.org/maven2/net/sf/jt400/jt400/9.4/
If I use the plugin 9.5 from maven in my POM file in Java Spring Boot then version 9.5 gives me this kind of error:
Invocation of init method failed; nested exception is java.lang.AbstractMethodError: com.ibm.as400.access.AS400JDBCConnection.isValid(I)Z.
Connection params:
spring.datasource.url=jdbc:as400://SLIGRO20/ZZPITTENSB;errors=full;prompt=false;date format=iso
spring.datasource.driver-class-name=com.ibm.as400.access.AS400JDBCDriver
In POM:
<dependency>
<groupid>net.sf.jt400</groupid>
<artifactid>jt400</artifactid>
<version>9.5</version>
</dependency>
Last edit: B. Pittens 2018-07-18
Ok, its like John Eberhard is mentioning. This can be fixed with a local Maven upload of the JT400-Jdk8....but its a dirty solution.
For me its ok.
I switched to jt400-jdk8 version 9.6 and it resolved this issue for me using Tomcat 8.5 (DBCP 2.4.0 (JDBC 4.1)) to resolve the java.lang.AbstractMethodError: com.ibm.as400.access.AS400JDBCConnectionImpl.isValid(I)Z.
After switching I was sometimes getting java.sql.SQLNonTransientConnectionException: Communication link failure. (Read timed out), but then it started working. I mention this because before I discovered the jt400-jdk8 artifact I tried switching from DBCP2 to Tomcat's DataSourceFactory. It also resolved the AbstractMethodError but was consistently giving
java.sql.SQLException: Communication link failure. (Read timed out). Maybe that was a transient network issue.
https://mvnrepository.com/artifact/net.sf.jt400/jt400-jdk8/9.6
Word of caution with the jdk8 / jdbc 4.2 version of jt400: for us it greatly increased the churn of connections to the iseries despite using a standard pool (Hikari; similar to DBCP but generally regarded as "better"). This was tested up through jt400 9.4, so there's a bit of a chance things improved in 9.5 or 9.6. Also a chance the problem relates to our combo usage of Hikari, but it performs just fine using the default jt400 version.