|
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 | |||||||||
java.lang.Object | +--com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl
Implementation of SQLExecutionManager that supports PreparedStatements and Statements, and has support for batching together similiar statements.
This class maintains an internal list of
SQLBuffers to execute, so that
similiar consecutive ones can be batched together for efficiency. Any
invocations of executeNow()
or executeQuery() will immediately flush
the list, since otherwise it would would not be possible to maintain
SQL execution order.
Implementation Note: This class does not do any
caching of statements itself. Great performance benefits
will be yielded from using a DataSource
implementation that does caching of PreparedStatements.
SQLExecutionManager,
SQLBuffer| Constructor Summary | |
|---|---|
SQLExecutionManagerImpl()
|
|
| 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. |
void |
execute(SQLBuffer buffer,
SQLExecutionCallback callback)
|
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. |
int[] |
executePreparedStatement(SQLBuffer[] buffer)
Execute the array of SQLBuffer statements as
PreparedStatements and return an array of the update counts. |
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. |
Connection |
getConnectionFromFactory()
Obtain a Connection from the connection factory, after
validating it against the DBDictionary.isClosed(java.sql.Connection) method. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SQLExecutionManagerImpl()
| Method Detail |
public void setConfiguration(JDBCConfiguration config)
SQLExecutionManagersetConfiguration in interface SQLExecutionManagerpublic JDBCConfiguration getConfiguration()
SQLExecutionManagergetConfiguration in interface SQLExecutionManagerpublic void setConnector(Connector connector)
SQLExecutionManagerConnector to be used for this manager.setConnector in interface SQLExecutionManagerpublic Connector getConnector()
SQLExecutionManagergetConnector in interface SQLExecutionManager
public Connection getConnection()
throws SQLException
SQLExecutionManagergetConnection in interface SQLExecutionManager
public Connection getConnectionFromFactory()
throws SQLException
Connection from the connection factory, after
validating it against the DBDictionary.isClosed(java.sql.Connection) method.Connectionpublic DBDictionary getDictionary()
SQLExecutionManagergetDictionary in interface SQLExecutionManager
public void execute(NonSelectingSQL statement)
throws SQLExceptionWrapper
SQLExecutionManagerexecute()
methods, flush() should
be invoked in order to ensure that statements are flushed to the
data store. For immediate execution, call the executeNow method.execute in interface SQLExecutionManagercom.solarmetric.kodo.impl.jdbc.SQLExecutionManagerSQLExecutionManager.executeNow(com.solarmetric.kodo.impl.jdbc.sql.NonSelectingSQL)
public void execute(NonSelectingSQL statement,
SQLExecutionCallback callback)
throws SQLExceptionWrapper
SQLExecutionManagerexecute()
methods, flush() should
be invoked in order to ensure that statements are flushed to the
data store. For immediate execution, call the executeNow method.execute in interface SQLExecutionManagercom.solarmetric.kodo.impl.jdbc.SQLExecutionManagerstatement - the Statement to executecallback - the callback to invoke after the update occursSQLExecutionManager.executeNow(com.solarmetric.kodo.impl.jdbc.sql.NonSelectingSQL)
public void execute(SQLBuffer buffer)
throws SQLExceptionWrapper
SQLExecutionManagerexecute()
methods, flush() should
be invoked in order to ensure that statements are flushed to the
data store. For immediate execution, call the executeNow method.execute in interface SQLExecutionManagercom.solarmetric.kodo.impl.jdbc.SQLExecutionManager#executeNow(com.solarmetric.kodo.impl.jdbc.SQLBuffer)
public void execute(SQLBuffer buffer,
SQLExecutionCallback callback)
throws SQLExceptionWrapper
public int[] flush()
throws SQLExceptionWrapper
SQLExecutionManagerflush in interface SQLExecutionManager
public int executeNow(NonSelectingSQL statement)
throws SQLExceptionWrapper
SQLExecutionManagerexecuteNow in interface SQLExecutionManagercom.solarmetric.kodo.impl.jdbc.SQLExecutionManagerSQLExecutionManager.executeNow(com.solarmetric.kodo.impl.jdbc.sql.NonSelectingSQL)
public int executeNow(SQLBuffer buffer)
throws SQLExceptionWrapper
SQLExecutionManagerexecuteNow in interface SQLExecutionManager
public ResultSet executeQuery(Select select)
throws SQLExceptionWrapper
SQLExecutionManagerexecuteQuery in interface SQLExecutionManager
public ResultSet executeQuery(Select select,
int type,
int concur)
throws SQLExceptionWrapper
SQLExecutionManagerexecuteQuery in interface SQLExecutionManagercom.solarmetric.kodo.impl.jdbc.SQLExecutionManagertype - the type of ResultSet to returnconcur - the concurrency of the ResultSet
public ResultSet executeQuery(SQLBuffer buffer)
throws SQLExceptionWrapper
SQLExecutionManagerexecuteQuery in interface SQLExecutionManager
public ResultSet executeQuery(SQLBuffer buffer,
int type,
int concur)
throws SQLExceptionWrapper
SQLExecutionManagerexecuteQuery in interface SQLExecutionManagercom.solarmetric.kodo.impl.jdbc.SQLExecutionManagertype - the type of ResultSet to returnconcur - the concurrency of the ResultSet
public int[] executePreparedStatement(SQLBuffer[] buffer)
throws SQLException
Execute the array of SQLBuffer statements as
PreparedStatements and return an array of the update counts.
This implementation decides to batch together the statements
or not depending on the setting of
JDBCConfiguration.getUseBatchedStatements()
public Collection getCallbackExceptions()
SQLExecutionManagergetCallbackExceptions in interface SQLExecutionManager
public void commit()
throws SQLException
SQLExecutionManagercommit in interface SQLExecutionManager
public void rollback()
throws SQLException
SQLExecutionManagerrollback in interface SQLExecutionManager
public void close()
throws SQLException
SQLExecutionManagerclose in interface SQLExecutionManager
public void close(ResultSet rs)
throws SQLException
SQLExecutionManagerclose in interface SQLExecutionManagerpublic boolean addSQLExecutionListener(SQLExecutionListener listener)
addSQLExecutionListener in interface SQLExecutionManagerpublic boolean removeSQLExecutionListener(SQLExecutionListener listener)
removeSQLExecutionListener in interface SQLExecutionManager
|
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 | |||||||||