DB2 - Problem description
| Problem IC64598 | Status: Closed |
ADMIN_GET_MSGS() FAILS IF DATABASE CODE PAGE DIFFERS TO SERVER CODE PAGE, WHEN CALLED FROM A JAVA PROGRAM. | |
| product: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
| Problem description: | |
If you execute SQL statement in MSG_RETRIEVAL column of
admin_cmd result set in a Java program as below when database
code page differs to server code page:
-------------
con = DriverManager.getConnection("jdbc:db2:sample");
// execute admin command
CallableStatement cs = con.prepareCall("call
admin_cmd('import from c:\\tmp\\test.txt of del messages on
server replace into test')");
cs.execute();
ResultSet rs = cs.getResultSet();
rs.next();
String retSQL = rs.getString("MSG_RETRIEVAL");
System.out.println(retSQL);
-------------
It fails with below error:
-------------
SELECT SQLCODE, MSG FROM TABLE(SYSPROC.ADMIN_GET_MSGS('4677_DB2
'))
AS MSG
SQL3109N:
com.ibm.db2.jcc.am.SqlException: [jcc][t4][1065][12306][3.57.82]
java.i
o.CharConversionException caught. See attached Throwable
ERRORCODE=-4220, SQLSTATE=null
-------------
If there is no code page conversion, database code page is same
as server code page, problem does not occur.
This is a platform independence problem so this problem can be
occured on Linux, Unix and Windows. | |
| Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * DB2 UDB Version 9.7. * **************************************************************** * PROBLEM DESCRIPTION: * * See Error description field for more information. * **************************************************************** * RECOMMENDATION: * * Upgrade to Version 9.7 FixPack 2. * **************************************************************** | |
| Local Fix: | |
N/A | |
| available fix packs: | |
DB2 Version 9.7 Fix Pack 2 for Linux, UNIX, and Windows | |
| Solution | |
Problem was first fixed in DB2 UDB Version 9.7 FixPack 2.
After moving from DB2 V97 GA / V97 FP1 to V9.7 FP2, if
db2updv97 is not run admin_get_msgs may fail with below error
message
hotel37:/home/hotel37/lappanna> db2 "SELECT SQLCODE, MSG FROM
TABLE(SYSPROC.ADMIN_GET_MSGS('1302342263_LAPPANNA')) AS MSG"
SQLCODE MSG
----------------------------------------------------------------
----------------------------------------------------------------
SQL0430N User defined function "SYSPROC.ADMIN_GET_MSGS"
(specific name
"ADMIN_GET_MSGS") has abnormally terminated. SQLSTATE=38503
Please run db2updv97 -d <dbname> to solve the above error. | |
| Workaround | |
not known / see Local fix | |
| BUG-Tracking | |
forerunner : APAR is sysrouted TO one or more of the following: IC64639 IC64640 IC66851 follow-up : | |
| Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 16.11.2009 16.06.2010 23.06.2010 |
| Problem solved at the following versions (IBM BugInfos) | |
9.7., 9.7.FP1, 9.7.FP2, 9.7.FP2 | |
| Problem solved according to the fixlist(s) of the following version(s) | |
| 9.7.0.2 |
|