DB2 SERVER从10.5.8升级到10.5.10之后,weblogic报错 java.lang.NumberFormatException: For input string: "A"

问题描述: 
DB2服务器从10.5.8升级到10.5.10之后,weblogic报错 java.lang.NumberFormatException: For input string: "A"
java.lang.NumberFormatException: For input string: "A"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:492)
    at java.lang.Integer.parseInt(Integer.java:527)
    at com.ibm.db2.jcc.c.md.<init>(md.java:64)
    at com.ibm.db2.jcc.a.f.<init>(f.java:44)
    at com.ibm.db2.jcc.a.b.cb(b.java:2003)
    at com.ibm.db2.jcc.c.p.a(p.java:3507)
    at com.ibm.db2.jcc.a.b.a(b.java:645)
    at com.ibm.db2.jcc.a.b.<init>(b.java:354)
    at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:165)
    at java.sql.DriverManager.getConnection(DriverManager.java:571)
    at java.sql.DriverManager.getConnection(DriverManager.java:187)

问题解决:
怀疑是weblogic自带的db2 jdbc driver有问题,位于目录~/domains/audit_domain/lib下,名子db2jcc.jar,于是从IBM官网上下载了一个新的驱动,代替了原来的,问题解决。


原因分析:

1. 可以看到db2 服务器上,10.5.10以下的版本, modification level都是数字,而10.5.10就变成了字母A
db2tst1@NODE01:~> db2level
DB21085I  This instance or install (instance name, where applicable: "db2tst1")
uses "64" bits and DB2 code release "SQL10058" with level identifier
"0609010E".
Informational tokens are "DB2 v10.5.0.8", "s160901", "IP23993", and Fix Pack
"8".
Product is installed at "/db2/software/10.5.8".

db2tst2@NODE01:~> db2level
DB21085I  This instance or install (instance name, where applicable: "db2tst2")
uses "64" bits and DB2 code release "SQL10059" with level identifier
"060A010E".
Informational tokens are "DB2 v10.5.0.9", "s170908", "IP24028", and Fix Pack
"9".
Product is installed at "/db2/software/10.5.9".

db2tst3@NODE01:~> db2level
DB21085I  This instance or install (instance name, where applicable: "db2tst3")
uses "64" bits and DB2 code release "SQL1005A" with level identifier
"060B010E".
Informational tokens are "DB2 v10.5.0.10", "s180615", "IP24053", and Fix Pack
"10".
Product is installed at "/db2/software/10.5.10".

2. 如果client(weblogic)的db2 jdbc driver版本是2.X的,那么它就不能识别SERVER上这种带字母的modification level。因此会报出上面的错误,在链接中有说明
http://www-01.ibm.com/support/docview.wss?uid=swg21990017

This happens when old DB2 JDBC driver version (2.X) cannot retrieve DB2 server fixpack version information higher than fixpack 9. (Fixpack 10 : 'A', Fixpack 11 : 'B')
The affected JDBC driver versions are 2.X which are included in DB2 server version 8.

3. 根据链接中的命令java -cp /your_path/db2jcc.jar com.ibm.db2.jcc.DB2Jcc  -version,查看了weblogic的db2 jdbc 驱动版本,发现果然是2.X,因此在升级驱动版本之后,问题解决了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值