All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.samples.daps.sql.InsertUpdateDelete

java.lang.Object
   |
   +----com.ibm.beans.samples.daps.sql.Common
           |
           +----com.ibm.beans.samples.daps.sql.Statement
                   |
                   +----com.ibm.beans.samples.daps.sql.DML
                           |
                           +----com.ibm.beans.samples.daps.sql.InsertUpdateDelete

public class InsertUpdateDelete
extends DML
The InsertUpdateDelete class is instantiated to represent a single SQL Insert, Update or Delete statement.

This class supports number of rows modified by the statement's execution.

To use the InsertUpdateDelete bean, do the following:

  1. Create an instance of the bean.
  2. Fill in the bean's properties (described below or in superclass):
  3. Bind an existing Connection bean's JDBCConnection property to this bean's JDBCConnection property. This will cause execution of the connect() method on the Connection bean to also set the JDBCConnection property on this bean.
  4. If parameter markers are used in the SQL statement, set up the inputs parameter. Each item in the Vector will correspond to the similarly-ordered parameter marker.
  5. Use the execute() method to execute the statement. The execute() method uses all the above properties to perform execution of the DDL statement. The execute() method sets values and fires property change events for the following properties on completion:
  6. Use the close() method to relinquish the statement's resources. The close() method sets values and fires property change events for the following properties on completion:

See Also:
InsertUpdateDeleteBeanInfo

Variable Index

 o numberRowsUpdated
An output count of the number of rows updated.

Constructor Index

 o InsertUpdateDelete()
Default constructor.

Method Index

 o closeBackground()
The actual background thread code that executes the close operation.
 o finalize()
Finalize this object.
 o getNumberRowsUpdated()
Get the number of rows modified by the latest statement execution.
 o handleResultMetaData()
Method to handle result meta data for an SQL Insert/Update/Delete statement.
 o setNumberRowsUpdated(int)
Set the number of rows modified by the latest statement execution.

Variables

 o numberRowsUpdated
 protected transient int numberRowsUpdated
An output count of the number of rows updated.

This field is set by the executeBackground() and closeBackground() methods.

Constructors

 o InsertUpdateDelete
 public InsertUpdateDelete()
Default constructor.

Methods

 o finalize
 protected void finalize() throws Throwable
Finalize this object.

Throws: Throwable
Possibly thrown by the superclass.
Overrides:
finalize in class DML
 o getNumberRowsUpdated
 public int getNumberRowsUpdated()
Get the number of rows modified by the latest statement execution.

Returns:
The number of rows modified by the latest statement execution.
 o setNumberRowsUpdated
 protected void setNumberRowsUpdated(int numberRowsUpdated)
Set the number of rows modified by the latest statement execution.

Methods setting this flag include execute() and close().

Fire the property change event for the numberRowsUpdated integer.

Parameters:
numberRowsUpdated - The number of rows modified by the latest statement execution.
 o handleResultMetaData
 protected void handleResultMetaData() throws SQLException
Method to handle result meta data for an SQL Insert/Update/Delete statement.

The numberRowsUpdated property is set by this method.

Throws: SQLException
Possibly thrown by the superclass
Overrides:
handleResultMetaData in class Statement
 o closeBackground
 protected void closeBackground() throws SQLException, NullPointerException
The actual background thread code that executes the close operation.

The numberRowsUpdated property is set by this method.

Throws: SQLException
SQL Exception
Throws: NullPointerException
Pointer not set
Overrides:
closeBackground in class DML

All Packages  Class Hierarchy  This Package  Previous  Next  Index