This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes DB2 - JDBC2.0 Batch update Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "DB2 - JDBC2.0 Batch update" Watch "DB2 - JDBC2.0 Batch update" New topic

DB2 - JDBC2.0 Batch update

sram bahl

Joined: Nov 26, 2002
Posts: 13
With DB2 JDBC2.0 drivers i am trying to do some batch updates. My prep stmt for an update works, but a prep stmt for a delete operation throws a runtime Exception like this,
Uncaught Exception (java.lang.UnSatisfiedLindError)
String query = "delete from user where userkey= ?";
PreparedStatement pstmt = (PreparedStatement) qm.getPrepStatement(query);

for (int i = 0; i < keyList.size(); i++) {
pstmt.setInt(1, (Integer.parseInt(keyList.get(i).toString())));
// throws exception here...
int[] updatecnt = pstmt.executeBatch();

Any clues?
sram bahl

Joined: Nov 26, 2002
Posts: 13
I figured out...seems the "inuse" file is erroneously updated to indicate that jdbc 2.0 is being used. I stopped all db2 processes and services and rerun the usejdbc2.bat command. It works now.
I agree. Here's the link:
subject: DB2 - JDBC2.0 Batch update
Similar Threads
Batch update problem in Spring Prepared statement
Closing batch update causes NullPointer.
Could not locate DB driver
howto modify database structure ?
JDBC addBatch problem