When update() method has to call?

Transient state? Transient state means, Object is neither associated with Session nor present in Database. When you don’t have record in the database, then you will not be able to update the record. So when the object is transient state you will not call update() method. Persistent state? Persistent state means, Object is associated with […]

Update table data using JDBC PreparedStatement API

Program to update table data using JDBC’s java.sql.PreparedStatement API.

 Output:

 In Database:                

Update table data using JDBC Statement API

Program to update table data using JDBC’s java.sql.Statement API.

Output:

In Database: