permaculture playing cards*
The moose likes JDBC and the fly likes how to do Batch updates? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how to do Batch updates?" Watch "how to do Batch updates?" New topic
Author

how to do Batch updates?

Laura Mike
Greenhorn

Joined: Nov 13, 2003
Posts: 17
hi again with a new problem.
How can i do batch updates in java.
mean whetehr we have any built in method to do batch insert,delelet,etc..
again ur help will be highly appreciated
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Check out java.sql.Statement's addBatch(String) and executeBatch()
Dave.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Oh, and if your update statements are very similar, you should probably play with java.sql.PreparedStatement's addBatch()
Laura Mike
Greenhorn

Joined: Nov 13, 2003
Posts: 17
Thanx David..i am trying to do it right now...
I am also planning to make my code talk to sql server database. in that situation what i have todo for migrating from Access tSQL server.like if i have to wite new queries or not. and any other issue to be consider for migration.
Also tell me if there is any example of connection to sql server is available i.e. how i will connect to sql server.(hey its not I (me) but my java app)
bye.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to do Batch updates?