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
is this error because of some of the values are greater than the length of the table column ??
However, I had logged all the 104 statements and executed them in a single shot using the Command Center Utility in DB2 UDB v7.0 and all the 104 went thru just fine
can anyone help me out here with what is wrong here
also is there an upper limit on the number of queries that can be added/executed using the batchUpdate feature?
Any help will be grateful
Regards<br /> <br />Abraham
Joined: Dec 10, 2004
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?
Joined: Sep 08, 2005
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+"';";