Hello,
I have a problem with the IBM DB2 UDB XML Extender. I`m working on a
iSeries 400 server (AS/400, V5R1) with a
integrated DB2 (my client is NT 4.0 Service Pack 1 with JDK1.1.8). I
want to create XML files out of the DB2 data
using the XML collections method and SQL mapping.
I successfully enabled my database, put the collection.dtd into
DTD_REF, created a DAD file and enabled the
collection (xcolltest01) using the OS/400 command line via Client
Access Express.
I can find the collection in my DB2XML.LIB on the server in the
XML_USAGE file.
To compose the XML document I wrote a Java program. When I start this
program (java testxml4), I always get the following
error message:
java.sql.SQLException: [CEE9901] Anwendungsfehler. MCH3402 nicht
überwacht durch QZXMDB2XML bei
Anweisung 0000000062, Instruktion X'0000'.
at com.ibm.as400.access.JDError,throwSQLException(JDE rror.java:388)
at com.ibm.as400.access.AS400JDBCStatement.commonExec ute(AS400JDBCStatement.java:640)
at com.ibm.as400.access.AS40JBDCPreparedStatement.exe cute(AS400JDBCPreparedStatement.java:692)
at testxml4.<init><testxml4.java:38>
at testxml4.main<testxml4.java:6>
When I enter "java testxml4" again right after the error message came,
I get another error message:
# of rows: 0
ReturnCode: -11
ErrorMessage: DXXQ016 Die Eingabetabelle RESULT_TAB konnte nicht
gefunden werden (my result table hasn`t been found, even though I
created a table with that name before)
This is a very interesting message because there seems to be a
connection to the database, so my java prog seems to
work fine.
I don`t know where the fault is:
1. A wrong way of creating a result table or
2. my java code
1. To create a result table I start SQL from the command line (STRSQL)
and write:
Create table RESULT_TAB(doc varchar(8000))
Then I get the information that the table has been created in QGPL but
without connecting to the journal. I don`t know if this is a problem
´cause I can find the empty table in QGPL.
2. Here`s my full java code that connects to the database and calls
the stored procedure dxxRetrieveXML():
_____
import java.sql.*;
public class testxml4 {
public static void main(String[] args) {
testxml4 mysql;
mysql = new testxml4(
"com.ibm.as400.access.AS400JDBCDriver","jdbc:as400 :S4420B1A", "delta",
"omega");
} //Treibername der DB2-Datenbank; JDBC-URL; Benutzername; Passwort;
means: DB2-Driver; JDBC-URL; Username; Password
public testxml4(String driver, String url, String user, String
password) {
Connection cn;
CallableStatement cs;
try {
Class.forName(driver);
cn = DriverManager.getConnection(url, user, password);
cs = cn.prepareCall("CALL DB2XML.dxxRetrieveXML(?, ?, ?, ?, ?, ?,
?, ?, ?, ?)");
cs.setString(1, "XCOLLTEST01"); // CollectionName
cs.setString(2, "RESULT_TAB"); // result table name
cs.setString(3, "xml_document"); // result column name
cs.setString(4, "valid_document"); // valid column name
cs.setInt(5, 0); // override type
cs.setString(6, "NO_OVERRIDE"); // override
cs.setInt(7, 100); // max # of rows
cs.registerOutParameter(8, Types.INTEGER); // actual # of rows
cs.registerOutParameter(9, Types.INTEGER); // return code
cs.registerOutParameter(10, Types.VARCHAR); // error message text
cs.execute();
System.out.println("# of rows: " + cs.getInt(8));
System.out.println("return Code: " + cs.getInt(9));
System.out.println("Message Text: " + cs.getString(10));
cn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
_____
I`m completely frustrated and don`t know what to do. Is there anyone
that can help me solving this problem?
Thanks in advance,
Marc