LUW DB2 JDBC Connection Issue on Open JDK 11

764 views Asked by At

I am not able to connect LUW DB2 database using JDBC Type4 driver on Open Zulu JDK 11.

I have tried all available latest DB2 JDBC Drivers (Type 4) but same issue with all drivers on JDK 11. Things are working fine on JDK 8.

Getting below error

Exception in thread "main" java.lang.NumberFormatException: For input string: "B"
    at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.base/java.lang.Integer.parseInt(Integer.java:652)
    at java.base/java.lang.Integer.parseInt(Integer.java:770)
    at com.ibm.db2.jcc.c.xc.<init>(xc.java:64)
    at com.ibm.db2.jcc.b.f.<init>(f.java:44)
    at com.ibm.db2.jcc.b.b.cb(b.java:1945)
    at com.ibm.db2.jcc.c.p.a(p.java:3284)
    at com.ibm.db2.jcc.b.b.a(b.java:625)
    at com.ibm.db2.jcc.b.b.<init>(b.java:334)
    at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:165)
    at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
    at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
    at com.aonhewitt.Test.main(Test.java:14)

Test Java Code

Class.forName("com.ibm.db2.jcc.DB2Driver");
Connection conn = DriverManager.getConnection("jdbc:db2://hostname:port/database","userid","password");

I would appreciate if anyone can help me here to connect to a DB2-LUW database from JDK 11

C:\>java -cp db2jcc4.jar com.ibm.db2.jcc.DB2Jcc -version 
IBM Data Server Driver for JDBC and SQLJ 4.25.23 


C:\>java -cp jcc-11.5.4.0.jar com.ibm.db2.jcc.DB2Jcc -version 
IBM Data Server Driver for JDBC and SQLJ 4.27.25 
0

There are 0 answers