executeBatch() program to Insert, Update and Delete

These JDBC Tutorials for Beginners “executeBatch() program” explains clearly how to execute different queries including insert, update and delete query using executeBatch() method of Statement interface.


 

SQL> desc emps ;
Name         Type
————————-
ENO        NUMBER
ENAME   VARCHAR2(30)
ESAL       NUMBER(7,2)

 

SQL> select *from emps;
ENO    ENAME    ESAL
———- ——————-
101     ram           30000
102     robert       40000
103     raheem     50000

 

 

Output:

 

Result explanation:

Records updated by Query-1 : 1 (insert 4th record)
Records updated by Query-2 : 3 (update salary of 3 records)
Records updated by Query-3 : 4 (delete all the 4 records)

Share this