Book Image

JDBC 4.0 and Oracle JDeveloper for J2EE Development

Book Image

JDBC 4.0 and Oracle JDeveloper for J2EE Development

Overview of this book

Table of Contents (20 chapters)
JDBC 4.0 and Oracle JDeveloper for J2EE Development
Credits
About the Author
About the Reviewer
Preface

Updating a Database Table


In this section, a database table row will be updated. Create a JSP catalogUpdate.jsp in the JSTLSQL project. As in the previous section, set the data source for the JSP page with the setDataSource tag. The UPDATE SQL statement is run with the sql:update tag. Add an Update tag to the JSP page from the Component Palette. The SQL statement has placeholders for specifying IN parameters for the UPDATE statement. Add the UPDATE SQL statement in the sql attribute of the sql:update tag.

<sql:update sql="UPDATE OE.CATALOG SET TITLE=?, AUTHOR=?
WHERE CATALOGID=?">
</sql:update>

The values for the IN parameters are specified with the sql:param tags. Position the cursor in the sql:update statement, and select the Param tag in the JSTL 1.1 SQL Component Palette.

The param value is set with the value attribute in the sql:param tag. To add the value attribute, press the space bar in the sql:param tag and double-click on the value attribute.

Specify the param value...