Insert Record JDBC Example

Insert Record JDBC Example

In the following program on Insert Record JDBC Example, 3 records are inserted in the Employee table in Oracle database.

Note: See that there exists an Employee table by the time this program is executed. This can be done with Create Table

Example on Insert Record JDBC Example

In this code, the Employee data is hard coded (should be known at compile time itself). In the next program, the data is taken from keyboard and inserted.

Note 1: Before going into the program, it is advised to go through JDBC Programming Basic Steps where the meaning of Connection, Statement etc. are discussed.

Note 2: To know how to use try-catch-finally with the above code, example program is available at JDBC Example – Create Table.

Leave a Reply

Your email address will not be published. Required fields are marked *