PreparedStatement Example in JDBC | JDBC Tutorials for Beginners

This JDBC Tutorials “PreparedStatement Example in JDBC” post providing how to insert records continuously into database using PreparedStatement object.


 

Emps table in database:

SQL> select *from emps;
ENO ENAME ESAL
———- ——————– ———-
1001 raam 30000
1002 robert 40000
1003 raheem 50000

 

Inserting records into emps:

  1. SQL> insert into emps(eno, ename) values(1004 , ‘amar’);
  2. SQL> insert into emps(eno, ename) values(1005 , ‘annie’);
  3. SQL> insert into emps(eno, ename) values(1006 , ‘aayan’);
  4. SQL> commit;

 

SQL> select *from emps;

ENO ENAME ESAL
———– ——————
1001 raam      30000
1004 amar
1002 robert    40000
1003 raheem 50000
1005 annie
1006 aayan

 

 

 

Share this