Hi
I've got a section of code that needs to run a few queries. I'm trying to run the addBatch and executeBatch methods as shown below:
conn6 = ods.getConnecti on();
stmt6 = conn6.createSta tement();
stmt6.addBatch( QueryString);
stmt6.addBatch( AnotherQueryStr ing);
stmt6.addBatch( YetAnotherQuery String);
stmt6.addBatch( AndOneMore);
stmt6.executeBa tch();
However, when the add batches are called it seems to run the queries as my database is being update so when it gets to the execute batch method i'm getting and sql error as it validates a primary key restraint!
However, if i remove the execute batch line then nothing is updated!
This seems very strange and may be something really simple i'm doing wrong.
If anyone could shed some light on this please it would be greatly appreciated.
Thanks
Matt
I've got a section of code that needs to run a few queries. I'm trying to run the addBatch and executeBatch methods as shown below:
conn6 = ods.getConnecti on();
stmt6 = conn6.createSta tement();
stmt6.addBatch( QueryString);
stmt6.addBatch( AnotherQueryStr ing);
stmt6.addBatch( YetAnotherQuery String);
stmt6.addBatch( AndOneMore);
stmt6.executeBa tch();
However, when the add batches are called it seems to run the queries as my database is being update so when it gets to the execute batch method i'm getting and sql error as it validates a primary key restraint!
However, if i remove the execute batch line then nothing is updated!
This seems very strange and may be something really simple i'm doing wrong.
If anyone could shed some light on this please it would be greatly appreciated.
Thanks
Matt