| Author |
batch updating mysql
|
mat buckland
Greenhorn
Joined: Sep 01, 2009
Posts: 24
|
|
I have a Container of objects in my server, which regularly need writing to the database. At the moment I simply iterate through the container and do an executeUpdate() for each object.
This is slow though. Is there a way I can create an update that will send all the objects to the database in one cumulative update instead of many?
thanks
|
 |
mat buckland
Greenhorn
Joined: Sep 01, 2009
Posts: 24
|
|
|
tis ok, i've found the answer!
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32611
|
|
Well done
For the benefit of future generations searching this forum, how did you do it?
|
 |
mat buckland
Greenhorn
Joined: Sep 01, 2009
Posts: 24
|
|
good point!
Like this:
http://www.java2s.com/Code/Java/Database-SQL-JDBC/BatchupdateforMySQL.htm
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32611
|
|
It's nice when you can find links like that, isn't it
|
 |
 |
|
|
subject: batch updating mysql
|
|
|