|
SolarMetric Kodo JDO 2.4.3 generated on March 27 2003 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Manager for execution SQL Statements. It provides the following services:
The lifespan of a SQLExecutionManager is the same as the lifespan
of a Connection's commit process. A single SQLExecutionManager
is associates with at most one Connection object. The
impementation may choose to only instantiate this Connection object
if SQL is actually going to be executed through the manager.
When the source invocation needs to know when the update has occured
(e.g., in order to check for the update count to validate that an
optimistic lock has not been violated), it can notify the Update with
a SQLExecutionCallback instance. E.g.,
mySQLExecutionManager.execute (myDelete, newThe callback will be invoked the next time the buffer is flushed (possibly upon the commit() method of the StoreManager).SQLExecutionCallback() { public void afterUpdate (SQLBufferbuffer, int updateCount) { if (updateCount == 0) throw newJDOUserException("An optimistic lock error occured"); } });
SQLExecution managers should be obtained through the factory
methods in SQLExecutionManagerFactory.
SQLBuffer,
SQLExecutionManagerFactory| Method Summary | |
|---|---|
boolean |
addSQLExecutionListener(SQLExecutionListener listener)
Adds a listerer to be notified whenever a SQL event occurs. |
void |
close()
Close the underlying Connection to the DataStore. |
void |
close(ResultSet rs)
Indicate to the manager that this ResultSet is no longer needed. |
void |
commit()
Flush any remaining queued statements and commit to the data store. |
void |
execute(NonSelectingSQL statement)
Execute the given SQLBuffer on the Connection, either in a batched or non-batched Statement or PreparedStatement. |
void |
execute(NonSelectingSQL statement,
SQLExecutionCallback callback)
Execute the given SQLBuffer on the Connection, either in a batched or non-batched Statement or PreparedStatement. |
void |
execute(SQLBuffer buffer)
Execute the given SQLBuffer on the Connection, either in a batched or non-batched Statement or PreparedStatement. |
int |
executeNow(NonSelectingSQL statement)
Execute the given NonSelectingSQL immediately, returning the number of updates made. |
int |
executeNow(SQLBuffer buffer)
Execute the given SQLBuffer update the specified Connection, either in a in a non-batched Statement or PreparedStatement. |
ResultSet |
executeQuery(Select select)
Execute the given Select statement on the specified Connection, either in a batched or non-batched Statement or PreparedStatement. |
ResultSet |
executeQuery(Select select,
int type,
int concur)
Execute the given Select statement on the specified Connection, either in a batched or non-batched Statement or PreparedStatement. |
ResultSet |
executeQuery(SQLBuffer buffer)
Execute the given SQLBuffer on the specified Connection, either in a batched or non-batched Statement or PreparedStatement. |
ResultSet |
executeQuery(SQLBuffer buffer,
int type,
int concur)
Execute the given SQLBuffer on the specified Connection, either in a batched or non-batched Statement or PreparedStatement. |
int[] |
flush()
Flush any pending statements in the queue and retun an array of the number of update counts. |
Collection |
getCallbackExceptions()
Return all user exceptions thrown by callbacks since the end of the last transaction. |
JDBCConfiguration |
getConfiguration()
Returns the JDBCConfiguration set in this object upon creation. |
Connection |
getConnection()
Returns the Connection that is being used for this manager. |
Connector |
getConnector()
Return the Connector in use by the SQLExecutionManager. |
DBDictionary |
getDictionary()
Returns the DBDictionary to use when creating SQL statements. |
boolean |
removeSQLExecutionListener(SQLExecutionListener listener)
Removes a listerer to be notified whenever a SQL event occurs. |
void |
rollback()
Rolls back the underlying connection. |
void |
setConfiguration(JDBCConfiguration config)
Set the Configuration for this object. |
void |
setConnector(Connector connector)
Set the Connector to be used for this manager. |
| Method Detail |
public void execute(NonSelectingSQL statement)
throws SQLException
execute()
methods, flush() should
be invoked in order to ensure that statements are flushed to the
data store. For immediate execution, call the executeNow method.executeNow(com.solarmetric.kodo.impl.jdbc.sql.NonSelectingSQL)
public void execute(NonSelectingSQL statement,
SQLExecutionCallback callback)
throws SQLException
execute()
methods, flush() should
be invoked in order to ensure that statements are flushed to the
data store. For immediate execution, call the executeNow method.statement - the Statement to executecallback - the callback to invoke after the update occursexecuteNow(com.solarmetric.kodo.impl.jdbc.sql.NonSelectingSQL)
public int executeNow(NonSelectingSQL statement)
throws SQLException
executeNow(com.solarmetric.kodo.impl.jdbc.sql.NonSelectingSQL)
public ResultSet executeQuery(Select select)
throws SQLException
public ResultSet executeQuery(Select select,
int type,
int concur)
throws SQLException
type - the type of ResultSet to returnconcur - the concurrency of the ResultSet
public void execute(SQLBuffer buffer)
throws SQLException
execute()
methods, flush() should
be invoked in order to ensure that statements are flushed to the
data store. For immediate execution, call the executeNow method.#executeNow(com.solarmetric.kodo.impl.jdbc.SQLBuffer)
public int executeNow(SQLBuffer buffer)
throws SQLException
public ResultSet executeQuery(SQLBuffer buffer)
throws SQLException
public ResultSet executeQuery(SQLBuffer buffer,
int type,
int concur)
throws SQLException
type - the type of ResultSet to returnconcur - the concurrency of the ResultSetpublic void setConfiguration(JDBCConfiguration config)
public JDBCConfiguration getConfiguration()
public void setConnector(Connector connector)
Connector to be used for this manager.public Connector getConnector()
public Connection getConnection()
throws SQLException
public DBDictionary getDictionary()
public int[] flush()
throws SQLException
public Collection getCallbackExceptions()
public void commit()
throws SQLException
public void close()
throws SQLException
public void rollback()
throws SQLException
public void close(ResultSet rs)
throws SQLException
public boolean addSQLExecutionListener(SQLExecutionListener listener)
public boolean removeSQLExecutionListener(SQLExecutionListener listener)
|
SolarMetric Kodo JDO 2.4.3 generated on March 27 2003 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||