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:
- Create an instance of the bean.
- Fill in the bean's properties (described below or in superclass):
- executeInBackground
- inputs
- SQLText
- 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.
- 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.
- 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:
- exception
- numberRowsUpdated
- successful
- 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:
- exception
- numberRowsUpdated
- successful
- See Also:
- InsertUpdateDeleteBeanInfo
-
numberRowsUpdated
- An output count of the number of rows updated.
-
InsertUpdateDelete()
- Default constructor.
-
closeBackground()
- The actual background thread code that executes the close operation.
-
finalize()
- Finalize this object.
-
getNumberRowsUpdated()
- Get the number of rows modified by the latest statement execution.
-
handleResultMetaData()
- Method to handle result meta data for an SQL Insert/Update/Delete
statement.
-
setNumberRowsUpdated(int)
- Set the number of rows modified by the latest statement execution.
numberRowsUpdated
protected transient int numberRowsUpdated
- An output count of the number of rows updated.
This field is set by the executeBackground() and closeBackground()
methods.
InsertUpdateDelete
public InsertUpdateDelete()
- Default constructor.
finalize
protected void finalize() throws Throwable
- Finalize this object.
- Throws: Throwable
- Possibly thrown by the superclass.
- Overrides:
- finalize in class DML
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.
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.
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
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