• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DB2 - JDBC2.0 Batch update

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
DB2PreparedStatement:SQLBindIntArray(int,int,...)
code:
String query = "delete from user where userkey= ?";
PreparedStatement pstmt = (PreparedStatement) qm.getPrepStatement(query);
qm.getConnection().setAutoCommit(false);

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

Any clues?
 
sram bahl
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic