Hi , i am quite new to this forum so kindly excuse any errors frm my side
Actually i have a requirement where in i need to update a large number of row ( abt 2000- 5000) in a single strech, hence i was trying to use the Batch Update facility provided by JDBC 2.0 but has met with limited success so far
Hi I have no idea why ur batch statement is failing. But i would like to suggest you one more way to execute the same. Create a prepared statement, then pass the values in the for loop and hit execute per row. This will be really fast then the Batch. I would request you to give a try. Let me know if you feel any concerns.
Regards Makarand Parab
Joined: Aug 10, 2005
Hi , actually the initial design was just the way u had suggested i.e creating a prepared statement and executing it for each record in the arraylist. However it seemed to be taking quite a long time esp with a larger number of records and that is why i was looking at using batch update functionality
but the error returned is quite strange even when i am able to manually execute each statement individually.
Any other possible reasons of failure for this method also any upper limit on the number of records that can be updated in one shot using batch update?
from the error it looks like some problem with the sql syntax. Are you sure that the SQL syntax is correct if it is so then tru adding a ;(semicolon) at the end of the statement which you would be submitting to the DB for execution (i.e) you try modifying +" WHERE CODE ='" +code+"'"; to +" WHERE CODE ='" +code+"';";