Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Batch Updates

 
Phillipe Rodrigues
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use addBatch() rather than addBatch(String)

eg


Essentially you were overwriting your operation each time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic