aspose file tools*
The moose likes JDBC and the fly likes Batch Updates Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Batch Updates" Watch "Batch Updates" New topic
Author

Batch Updates

Phillipe Rodrigues
Ranch Hand

Joined: Oct 30, 2007
Posts: 165
The below program for batch update operation is not inserting values in database.Please let me know where i am doing wrong.



Output:
mysql> select * from student_name;
+---------------+
| name |
+---------------+
| first student |
| third |
| second |
| fourth |
| fifth |
| sixth |
| sixth |
| sixth |
| seventh |
| seventh |
| eight |
| nine |
| eleventh |
+---------------+
13 rows in set (0.00 sec)


Thanks,
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

use addBatch() rather than addBatch(String)

eg


Essentially you were overwriting your operation each time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Batch Updates
 
Similar Threads
Error during Batch Updates
JDBC Performance Win vs. AS/400
Using a jsf DAO interface
execute batch is not executing all the queries.
Batch update in EJB