CwDBConnection class

The CwDBConnection class provides methods for executing SQL queries in a database. Queries are performed through a connection, which is obtained from a connection pool. To instantiate this class, you must call getDBConnection() in the BaseCollaboration class. All collaborations are derived or subclassed from BaseCollaboration so they have access to getDBConnection().

Table 62 summarizes the methods in the CwDBConnection class.

Table 62.
CwDBConnection method summary
Method Description Page
beginTransaction() Begins an explicit transaction for the current connection. beginTransaction()
commit() Commits the active transaction associated with the current connection. commit()
executeSQL() Executes a static SQL query by specifying its syntax and an optional parameter array. executeSQL()
executePreparedSQL() Executes a prepared SQL query by specifying its syntax and an optional parameter array. executePreparedSQL()
executeStoredProcedure() Executes an SQL stored procedure by specifying its name and parameter array. executeStoredProcedure()
getUpdateCount() Returns the number of rows affected by the last write operation to the database. getUpdateCount()
hasMoreRows() Determines whether the query result has more rows to process. hasMoreRows()
inTransaction() Determines whether a transaction is in progress in the current connection. inTransaction()
isActive() Determines whether the current connection is active. isActive()
nextRow() Retrieves the next row from the query result. nextRow()
release() Releases use of the current connection, returning it to its connection pool. release()
rollBack() Rolls back the active transaction associated with the current connection. rollBack()

Copyright IBM Corp. 2003, 2004