• 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

Closing batch update causes NullPointer.

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,
I have a method that does a batch update to a database. I use a preparedStatement with bind variables to build the batch update. I can prepare the sql statement set the bind variables for every loop iteration. The executeBatch statement works fine. But in my finally, when I try to close the preparedStatement I get a nullPointerException. By inspecting the variables at runtime I can confirm that the preparedStatement is NOT null. Something in the .close method is causing this.
Here is an example of what I am doing...

I have run similar examples that only update 1 record without the batch statement calls and everything works fine.
Does anyone know of a bug with batch updates? Or am I doing something wrong.

My env is:
IDE: Websphere WSAD 5.0
AppServer: Websphere Advanced Edtion 4.0
DB: ORACLE 9i (9.2.0.1)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic