Class com.ibm.db.SQLStatement
java.lang.Object
|
+----com.ibm.db.Statement
|
+----com.ibm.db.SQLStatement
- public class SQLStatement
- extends Statement
SQLStatement represents an SQL statement that doesn't return a result set.
- See Also:
- Statement
Constructor Index
- SQLStatement()
- Constructs a new SQLStatement.
Method Index
- addPropertyChangeListener(PropertyChangeListener)
- Adds a listener to the PropertyChange event set.
- cancelExecution()
- Cancels execution of the SQL statement which is associated with
this SQLStatement.
- execute()
- Executes the SQL statement.
- firePropertyChange(String, Object, Object)
- The firePropertyChange method was generated to support the propertyChange field.
- getNumAffectedRows()
- Returns the number of rows that were affected by executing the SQL statement.
- removePropertyChangeListener(PropertyChangeListener)
- Removes a listener to the PropertyChange event set.
Constructors
SQLStatement
public SQLStatement()
- Constructs a new SQLStatement.
Methods
addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
- Adds a listener to the PropertyChange event set. PropertyChange events occur
when the bound property numAffectedRows is changed.
- Parameters:
- listener - PropertyChangeListener
- See Also:
- removePropertyChangeListener
cancelExecution
public void cancelExecution() throws DataException
- Cancels execution of the SQL statement which is associated with
this SQLStatement. In order to use this method, it must be invoked
from a thread different from the one in which the SQL statement is running.
- Throws: DataException
- noConnection
- if no associated DatabaseConnection
- Throws: DataException
- notExecuting
- if the statement is not currently being executed
- Throws: DataException
- sqlException
- if an SQLException occurred
- Overrides:
- cancelExecution in class Statement
execute
public void execute() throws DataException
- Executes the SQL statement. If needed, a connection is made to the database prior
to executing the SQL statement, using the associated DatabaseConnection. The SQL
statement is obtained from the StatementMetaData associated with this SQLStatement.
The events aboutExecute
and executed
are
triggered by this method.
- Throws: DataException
- noConnection
- if no associated DatabaseConnection
- Throws: DataException
- noSQL
- if the SQL statement is null
- Overrides:
- execute in class Statement
- See Also:
- DatabaseConnection
- StatementMetaData
firePropertyChange
public void firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
- The firePropertyChange method was generated to support the propertyChange field.
getNumAffectedRows
public int getNumAffectedRows()
- Returns the number of rows that were affected by executing the SQL statement.
- Returns:
- the number of affected rows
removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
- Removes a listener to the PropertyChange event set. PropertyChange events occur
when the bound property numAffectedRows is changed.
- Parameters:
- listener - PropertyChangeListener
- See Also:
- addPropertyChangeListener
