This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Having trouble with executeBatch

 
Reggie McDougal
Ranch Hand
Posts: 69
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For some reason execute batch will not update the database, now I have tried testing the batch with a ps.setString (1, "testData") and still no cigar, it looks right to me I just can't see why the database is not updating.

error is an ArrayList by the way.

 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe setString wants a 0-indexed number as its parameter. So, you should be giving it a 0 instead of 1 -- unless I'm misunderstanding something here ....
 
Fisher Daniel
Ranch Hand
Posts: 582
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Reggie,
I think you should add this after you get database connection..



And Nathaniel, according to JDBC Specification, the setting parameter always start with 1 instead of 0-index.

Correct me if I am wrong...
Hope this help
daniel
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33697
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Daniel is correct. JDBC uses indexes starting with 1.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic