In the book "JDBC API tutorial and Reference, Second Edition" page 823 talks about BatchUpdate and catching the exceptions but
if you are using SQL 7.0 the SQL you can generate an error in sql and a exception will not be thrown example
a Table call test with the structure of
FirstName varchar(5)
LastName varchar(5)
try{
stmt.addBatch("Insert into test (FirstName,LastName) values ('Rob','Jones')"
stmt.addBatch("Insert into test (FirstName,LastName) values('Jim','Johnson')"
int[] updateCounts = stmt.executeBatch()}
catch(BatchUpdateException b){}
Using BatchUpdate the above statements will not throw a exception but the second record will not be add the the
SQL table but the first one will .
int[] updateCounts = stmt.executeBatch()
will return
updateCounts[0]=1
updateCounts[1]=1
but should return
updateCounts[0]=1
updateCounts[1]=0
and throw a exception
Which is not true.
Help!!!! what is the correct statements
Thanks
Robert