Update Record JDBC Example with GUI

Update Record JDBC Example with GUI

After inserting and deleting records, let us make one more program that updates the salary of a record. In this program, GUI environment is used to take employee ID and display the result. The output is planned to display the particulars like employee id, name, old salary and new salary after updating and the amount of salary incremented. TextField is used to take input of ID and TextArea to display the result.

Update Record JDBC

Even if one record exist, res.next() should be used as the record pointer by default placed above first record. The record pointer is moved to the first record with res.next() method. This is discussed in JDBC Select Records Example

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 *