Java Reference
In-Depth Information
In this case the
Variable Name
field will hold the number of rows that were deleted,
the
Scope
and
Data Source
fields hold the scope for the
Variable Name
field and the
JNDI name for the data source to be used to connect to the database, respectively.
The
Delete Statement
field contains the SQL
DELETE
statement we will use to
delete data from the database, notice in our example, we used a question mark as a
placeholder for an
<sql:param>
tag.
After clicking on the
OK
button, the following markup is generated in our page:
<sql:update var="deletedRows" dataSource="jdbc/sample">
DELETE FROM customer
WHERE name LIKE ?
</sql:update>
In order to substitute the question mark with the appropriate value, we need to add
an
<sql:param>
tag inside the
<sql:update>
tag.
<sql:update var="deletedRows" dataSource="jdbc/sample">
DELETE FROM customer
WHERE name like ?
<sql:param value="Ensode%"/>
</sql:update>