Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xml / Data Typer mismatch

 
Stu Boulton
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I'm a complete Java and XML beginner and am trying to parse some xml on the iseries.
I've copied a test program of the IBM website to parse an XML file and get it into a DB400 file and am slowly debugging it on the AS400. I'm getting to a method
//;**********************************************
//;Initialise the insert statement
//;
//;
public static void clearPrepSqlParms() {
int r;
try {
for (r = 1; r <= 22; r++) {
psAddress.setString(r, "?");
}
} catch (java.sql.SQLException e) {
e.printStackTrace();
}
}
and receive the message:
e = com/ibm/db2/jdbc/app/DB2JDBCException:F62737DA1701E230
e.SQLState=07006
e.next=null
e.vendorCode=-99999
The prepared insert statement is as follows
psAddress =
dbCon.prepareStatement( "INSERT INTO TEST.ADSBKDP "+
"(AYPNUM, AYSBIP, AYSQNO, AYORDN, AYSDSQ, AYDA01, AYDA02, AYDA03, "+
"AYDA04, AYDA05, AYDA06, AYDA07, AYDA08, AYSDCR, AYSDQT, AYBDTP, "+
"AYDCCD, AYDBDS, AYBDST, AYCOCD, AYPSCD, AYSCMP) "+
"VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ");
as the program has already built the statement previously and not thrown an eception why when I call the method clearPrepSqlParms() does an exception get thrown.( and why does it involve "JDBC")
Thanks in advance
Stu
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic