DB2 - Problembeschreibung
Problem IC65851 | Status: Geschlossen |
RECEIVE JAVA.LANG.NULLPOINTEREXCEPTION WHEN ACCESSING VALUE OF CURSOR TYPED OUTPUT PARAMETER RETURNED BY A SQL CALL STATEMENT | |
Produkt: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problembeschreibung: | |
You receive a java.lang.NullPointer exception from com.ibm.db2.jcc.am.vm.getObject when attempting to get the value of a cursor typed output parameter returned by an SQL Call statement, and literal values were used for at least one input parameter. Example Create Procedure DDL: CREATE PROCEDURE P1(IN V1 INTEGER, OUT CV1 CURSOR) BEGIN SET CV1 = CURSOR FOR VALUES(V1); END Example Java Code: The example assumes that the conn variable represents an instance of the Connection class with an open connection to a database where the procedure P1 has been defined. CallableStatement cstmt = conn.prepareCall("CALL P1(42, ?"); cstmt.registerOutParameter(1, com.ibm.db2.jcc.DB2Types.CURSOR); cstmt.execute(); ResultSet rs = (ResultSet)cstmt.getObject(1); <-- Throws java.lang.NullPointerException Exception Call Stack: java.lang.NullPointerException at com.ibm.db2.jcc.am.gc.a(gc.java:1822) at com.ibm.db2.jcc.am.vm.A(vm.java:1039) at com.ibm.db2.jcc.am.vm.getObject(vm.java:1017) | |
Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * Java applications using JCC Type 4 Driver against DB2 forLUW * * 9.7 server. * **************************************************************** * PROBLEM DESCRIPTION: * * You receive a java.lang.NullPointer exception * * fromcom.ibm.db2.jcc.am.vm.getObject when attempting to get * * thevalue of a cursor typed output parameter returned by an * * SQLCall statement and literal values were used for at least * * oneinput parameter.Example Create Procedure DDL:CREATE * * PROCEDURE P1(IN V1 INTEGER, OUT CV1 CURSOR)BEGINSET CV1 = * * CURSOR FOR VALUES(V1);ENDExample Java Code:The example * * assumes that the conn variable represents aninstance of the * * Connection class with an open connection toa database where * * the procedure P1 has been defined.CallableStatement cstmt = * * conn.prepareCall("CALL P1(42, * * ?");cstmt.registerOutParameter(1,com.ibm.db2.jcc.DB2Types.CURS * rs = (ResultSet)cstmt.getObject(1); <-- * * Throwsjava.lang.NullPointerExceptionException Call * * Stack:java.lang.NullPointerExceptionat * * com.ibm.db2.jcc.am.gc.a(gc.java:1822)at * * com.ibm.db2.jcc.am.vm.A(vm.java:1039)at * * com.ibm.db2.jcc.am.vm.getObject(vm.java:1017) * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 for LUW version 9.7 Fix Pack 2. * **************************************************************** | |
Local-Fix: | |
verfügbare FixPacks: | |
DB2 Version 9.7 Fix Pack 2 for Linux, UNIX, and Windows | |
Lösung | |
Problem was first fixed in Version 9.7 Fix Pack 2. This fix should be applied on the server. You will no longer receive a java.lang.NullPointer exception from com.ibm.db2.jcc.am.vm.getObject when retrieving the value of a Cursor typed output parameter from an SQL Call statement. | |
Workaround | |
keiner bekannt / siehe Local-Fix | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 26.01.2010 05.07.2010 05.07.2010 |
Problem behoben ab folgender Versionen (IBM BugInfos) | |
9.7.FP2 | |
Problem behoben lt. FixList in der Version | |
9.7.0.2 |