Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

prepared statement in batch always returning an array of -2

 
G Ranjith
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Im using prepared statement. The statement is prepared outside the loop.
Inside the loop, datas are varied and added to batch.
On executing the batch , it returns an integer array.
The problem is , the values in the array are always -2 independent of whether the status is true or false.
Im always getting an array of -2(array length is equal to loop) even though sometimes database is upadated and sometimes not updated.

Any help in this regard is welcome.

Thanks in advance...
 
stu derby
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you get depends on which database driver you're using. I'm guessing you're using the Oracle driver, 'cause that's what yo get from it:
http://www.stanford.edu/dept/itss/docs/oracle/9i/java.920/a96654/oraperf.htm#1057093
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic