We are using Java applications with JDBC/JTOpen to AS400/IBM i DB2. Currently using JTOpen v.10.5 which works fine. Trying to upgrade to latest v.10.7 but it fails with:
java.sql.SQLException: No suitable driver found for jdbc:as400://myserver.domain.net/MYDB;
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:706)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:229)
at TestMain.main(TestMain.java:14)
Same goes for v.10.6
Using a very simple test client:
import java.sql.*;
public class TestMain {
static final String DB_URL = "jdbc:as400://myserver.domain.net/MYDB;";
static final String USER = "myuser";
static final String PASS = "mypasswd";
static final String QUERY = "select * from MYTABLE";
public static void main(String[] args) {
try(Connection conn = DriverManager.getConnection(DB_URL, USER, PASS);
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(QUERY);) {
while (rs.next()) {
System.out.print("IRAVTNR: " + rs.getString("IRAVTNR"));
System.out.println(", IRISUF: " + rs.getInt("IRISUF"));
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}
I cannot see anything relevant in the changelog. Do you have any idea what is failing?
Even though we are using Java 17, I tested with the one in
java8/jt400.jar
and that works fine. The main jar in root works if you addClass.forName...