JDBC batch creation in Sybase
I need to update a table with about 5 million rows
Righht now I have 100 batches and it works normally But when I add more than 100 batches, I get an exception: com sybase. jdbc2. jdbc. Sybbatchupdateexception: jz0be: batchupdateexception: error executing batch statement: message is empty
How to have more batch statements in the callablestatement object
Solution
There is not enough reputation to comment... But what type of statement are you batching? How many lines have you updated? Does the table have a primary key? How many columns are in the table and how many columns have you updated?
The JDBC framework in Sybase is very fast You can at least consider writing a simple process to receive the primary key (or other) information you use to identify the row, and use the new value updated to the row as the input variable This process updates only the single line
Wrap this process in your own Java method, which handles callablestatement, registers your error number and error message parameters, etc
You can then iterate over any construct you are using to update the data and use the same Java method call procedure to update the values line by line
Again, I don't know how many things you have to do... But I know if you want a single line update, which will be very fast