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

Deleting a Row


Next, we will delete a row from the OracleWebRowSet object. Click on the Modify Web RowSet link in the UpdateRow JSP. In the ModifyWebRowSet JSP click on the Delete Row link. In the Delete Row JSP specify the row to delete and click on Apply. For example, delete the third row.

In the DeleteRow JSP the deleteRow() method of the WebRowSetQuery Java class is invoked. The WebRowSetQuery object is retrieved from the session object:

WebRowSetQuery query=( webrowset.WebRowSetQuery)
session.getAttribute("query");

In the deleteRow() method the OracleWebRowSet object cursor is moved to the row to be deleted:

webRowSet.absolute(row);

Delete the row with the deleteRow() method of the OracleWebRowSet object. The create, update, and delete operations are performed on the OracleWebRowSet object, not on the database table. The DeleteRow.jsp is as follows:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text...