JDBC Tutorial #10 : Batch Operations

It is a little tiring to do single operation with each execution. JDBC provides an option to do batch operations. The addBatch() method of Statement, PreparedStatement, and CallableStatement is used to add individual statements to the batch. The executeBatch() is used to start the execution of all the statements grouped together. The executeBatch() returns an array of integers, and each element of the array represents the update count for the respective update statement. This tutorial series covers following topics ■ Connecting Java Program to MySQL Database ■ Inserting data into database ■ Fetching data from database ■ Updating an entry in database ■ Deleting an entry from database ■ Creating a table programmatically ■ Using PreparedStatements ■ Display database contents in JTable ■ Calling stored procedures ■ JDBC Batch operations
Back to Top