JDBC CS Update with executeUpdate

How do we perform SQL Update with the executeUpdate()
method contained in a JDBC-CallableStatement object.

With a DB connection, you must write the SQL statement
and let this statement
be the parameter to the below specified prepareCall() method.

The SQL statement must do a call to a database stored procedure
that do a SQL Update into a database table.

If you have any parametric placeholders for
values in your SQL statement, then it is time to
set these using the PreparedStatement
setXXX() methods.

If any parametric placeholder exists in your
SQL statement which can result in an output
from the database-stored procedure or function
you want to call, then it is time to
set the type for these using the CallableStatement
registerOutPutParameter() methods.

With the returned CallableStatement object, you can execute the following
method to perform the SQL Update statement:

Method in CallableStatement interface

Description

int executeUpdate()

Executes the SQL procedure call statement in this
CallableStatement object. The database procedure must do an SQL Data Manipulation
Language (DML) statement, such as INSERT, UPDATE or DELETE;
or an SQL statement that returns nothing, such as a DDL statement.

The CallableStatement object will now contain
requested database data, which can be retrieved with the
getXXX() methods.

Example of using this method to Update a database table
through a database-stored procedure: