All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.beans.samples.daps.sql.Statement
java.lang.Object
|
+----com.ibm.beans.samples.daps.sql.Common
|
+----com.ibm.beans.samples.daps.sql.Statement
- public abstract class Statement
- extends Common
The Statement class is instantiated via subclasses to represent a single
SQL statement. Added functionality includes support for the
JDBCConnection and SQLText properties, and the general flow of the
execute() and close() methods.
Multiple instances of subclasses of Statement are all related to a
single instance of Connection.
This class is an abstract class used by the DDL and DML classes.
- See Also:
- Connection, DDL, DML, StatementBeanInfo
-
CLOSE
- Background thread closing SQL statement.
-
EXECUTE
- Background thread executing SQL statement.
-
JDBCConnection
- The JDBC java.sql.connection provided by a Connection object.
-
LASTTASK
- Last possible task value.
-
preparedStatement
- The java.sql.PreparedStatement encapsulated by this Statement object.
-
SQLText
- The SQL statement text for this statement.
-
Statement()
- Default constructor.
-
close()
- Close a statement and free the statement resources.
-
closeBackground()
- The actual background thread code that executes the close operation.
-
execute()
- Execute a statement.
-
executeBackground()
- The actual background thread code that executes the statement.
-
executeStatement()
- Method to execute an SQL statement.
-
finalize()
- Finalize this object.
-
getJDBCConnection()
- Returns the JDBC database JDBCConnection object from a Connection
object.
-
getSQLText()
- Get the SQL text.
-
handleInputValues()
- Method to handle input values for an SQL statement.
-
handleResultMetaData()
- Method to handle result meta data for an SQL statement.
-
performWork()
- Call method based on the background task to be performed.
-
prepareStatement()
- Method to prepare SQL statement and rethrow any exceptions.
-
setJDBCConnection(Connection)
- Set the JDBC database connection object.
-
setSQLText(String)
- Set the SQL text.
JDBCConnection
protected transient Connection JDBCConnection
- The JDBC java.sql.connection provided by a Connection object.
This value is used by the executeBackground() and prepareStatement()
methods.
It must be set prior to the execute() method.
- See Also:
- Connection, Connection
SQLText
protected String SQLText
- The SQL statement text for this statement.
This value is used by the prepareStatement() method.
This property must be set prior to the execute() method.
preparedStatement
protected transient PreparedStatement preparedStatement
- The java.sql.PreparedStatement encapsulated by this Statement object.
- See Also:
- PreparedStatement
EXECUTE
protected static final transient int EXECUTE
- Background thread executing SQL statement.
CLOSE
protected static final transient int CLOSE
- Background thread closing SQL statement.
LASTTASK
protected static final transient int LASTTASK
- Last possible task value.
This is used by the Select class.
Statement
public Statement()
- Default constructor.
finalize
protected void finalize() throws Throwable
- Finalize this object.
- Throws: Throwable
- Possibly thrown by the superclass.
- Overrides:
- finalize in class Common
getJDBCConnection
public Connection getJDBCConnection()
- Returns the JDBC database JDBCConnection object from a Connection
object.
- Returns:
- The java.sql.Connection object; null if not connected.
setJDBCConnection
public synchronized void setJDBCConnection(Connection JDBCConnection)
- Set the JDBC database connection object.
This value is used by the execute() method.
This method will typically called via wiring or scripting
to set the Connection
object from a Connection.
Fire the property change event for the JDBCConnection object.
- Parameters:
- JDBCConnection - The JDBC database connection.
getSQLText
public String getSQLText()
- Get the SQL text.
- Returns:
- The SQL text specifying the SQL statement for this object.
setSQLText
public synchronized void setSQLText(String SQLText)
- Set the SQL text.
This value is used by the execute() method.
Fire the property change event for the SQLText string.
- Parameters:
- SQLText - The SQL text specifying the SQL statement for this object.
execute
public synchronized void execute()
- Execute a statement.
The JDBCConnection and SQLText properties are used by this method's
background thread operation.
The exception and successful properties are indirectly set by this
method.
This methods background thread operation invokes the
prepareStatement(), handleInputValues(), executeStatement() and
handleResultMetaData() methods
that are overridden by the various Statement subclasses.
- See Also:
- executeBackground
executeBackground
protected void executeBackground() throws SQLException, NullPointerException
- The actual background thread code that executes the statement.
The JDBCConnection property is used by this method.
- Throws: SQLException
- SQL Exception
- Throws: NullPointerException
- Pointer not set
prepareStatement
protected void prepareStatement() throws SQLException
- Method to prepare SQL statement and rethrow any exceptions.
The JDBCConnection property is used by this method.
- Throws: SQLException
- Thrown by the JDBCConnection's
prepareStatement method
handleInputValues
protected void handleInputValues() throws SQLException
- Method to handle input values for an SQL statement.
- Throws: SQLException
- Thrown by subclasses
executeStatement
protected void executeStatement() throws SQLException
- Method to execute an SQL statement.
- Throws: SQLException
- Thrown by the preparedStatement's
execute() method.
handleResultMetaData
protected void handleResultMetaData() throws SQLException
- Method to handle result meta data for an SQL statement.
- Throws: SQLException
- Thrown by subclasses
close
public synchronized void close()
- Close a statement and free the statement resources.
The exception and successful properties are indirectly set by this
method.
- See Also:
- closeBackground
closeBackground
protected void closeBackground() throws SQLException, NullPointerException
- The actual background thread code that executes the close operation.
- Throws: SQLException
- SQL Exception
- Throws: NullPointerException
- Pointer not set
performWork
protected void performWork() throws SQLException, NullPointerException
- Call method based on the background task to be performed.
The caller has guaranteed this will NOT be called for the
INITIAL task.
- Throws: SQLException
- SQL Exception
- Throws: NullPointerException
- Pointer not set
- Overrides:
- performWork in class Common
All Packages Class Hierarchy This Package Previous Next Index