-
BatchUpdate
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks