Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Java
Expertise: Intermediate
Feb 12, 2001

Using Addbatch and Executebatch


If you insert/update/delete multiple times to the database, you can improve performance by using the addbatch and executebatch methods of statement objects. One drawback about using this method is that it only works for JDBC 2.0.
 
Tip: Statement stmt = con.getStatement( );
stmt.addBatch( sql statment );
stmt.addBatch( sql statment );
stmt.addBatch( sql statment );
stmt.addBatch( sql statment );
..
stmt.executeBatch( );
Tri Do
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap