|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensubsystems.core.persist.db.mysql.MySQLDataUtils
public final class MySQLDataUtils
This class collects code fragments which are reusable for managing data in MySQL.
| Nested Class Summary | |
|---|---|
static class |
MySQLDataUtils.CachedInsertStatements
Class used to encapsulate and hold cached statements between method calls. |
static class |
MySQLDataUtils.CachedUpdateStatements
Class used to encapsulate and hold cached statements between method calls. |
| Method Summary | |
|---|---|
static MySQLDataUtils.CachedInsertStatements |
cacheStatementsForInsert(java.sql.Connection dbConnection,
boolean bIsInDomain,
java.lang.String strTableName,
boolean bModifiable)
Cache the statements required by subsequent calls to this class. |
static MySQLDataUtils.CachedUpdateStatements |
cacheStatementsForUpdate(java.sql.Connection dbConnection,
boolean bIsInDomain,
java.lang.String strTableName)
Cache the statements required by subsequent calls to this class. |
static void |
closeStatements(MySQLDataUtils.CachedInsertStatements cache)
Release the statements cached by cacheStatementsForXXX. |
static void |
closeStatements(MySQLDataUtils.CachedUpdateStatements cache)
Release the statements cached by cacheStatementsForXXX. |
static void |
fetchModifiedTimestamps(MySQLDataUtils.CachedUpdateStatements cache,
ModifiableDataObject data)
Check errors and fetch from the database generated modification timestamps for the updated data object. |
static void |
insertAndFetchGeneratedValues(java.sql.Connection dbConnection,
java.sql.PreparedStatement insertStatement,
boolean bIsInDomain,
java.lang.String strTableName,
BasicDataObject data)
Insert the data, fetch from the database id and generated creation and modification timestamps for the newly created data object. |
static void |
insertAndFetchGeneratedValues(java.sql.PreparedStatement insertStatement,
MySQLDataUtils.CachedInsertStatements cache,
BasicDataObject data)
Insert the data, fetch from the database id and generated creation and modification timestamps for the newly created data object. |
static void |
updatedAndFetchGeneratedValues(java.lang.String strDataName,
java.sql.Connection dbConnection,
java.sql.PreparedStatement updateStatement,
boolean bIsInDomain,
java.lang.String strTableName,
ModifiableDataObject data)
Update the data, check for errors and fetch from the database generated modification timestamps for the updated data object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void insertAndFetchGeneratedValues(java.sql.Connection dbConnection,
java.sql.PreparedStatement insertStatement,
boolean bIsInDomain,
java.lang.String strTableName,
BasicDataObject data)
throws java.sql.SQLException,
OSSException
dbConnection - - connection to use to access the databaseinsertStatement - - statement used to insert the databIsInDomain - - are the data objects maintained in domainsstrTableName - - name of the tabledata - - data object to update
java.sql.SQLException - - an error has occured
OSSException - - an error has occured
public static void insertAndFetchGeneratedValues(java.sql.PreparedStatement insertStatement,
MySQLDataUtils.CachedInsertStatements cache,
BasicDataObject data)
throws OSSException,
java.sql.SQLException
insertStatement - - statement used to insert the datacache - - cached jdbc statementsdata - - data object to update
OSSException - - an error accessing database
java.sql.SQLException - - an error while inserting data
public static MySQLDataUtils.CachedInsertStatements cacheStatementsForInsert(java.sql.Connection dbConnection,
boolean bIsInDomain,
java.lang.String strTableName,
boolean bModifiable)
throws OSSException
dbConnection - - connection to use to access the datavasebIsInDomain - - are the data objects maintained in domainsstrTableName - - name of the tablebModifiable - - is the data object modifiable
OSSException - - an error accessing the databasepublic static void closeStatements(MySQLDataUtils.CachedInsertStatements cache)
cache - - cache to release
public static void updatedAndFetchGeneratedValues(java.lang.String strDataName,
java.sql.Connection dbConnection,
java.sql.PreparedStatement updateStatement,
boolean bIsInDomain,
java.lang.String strTableName,
ModifiableDataObject data)
throws java.sql.SQLException,
OSSException
strDataName - - name of the data objectdbConnection - - connection to use to access the datavaseupdateStatement - - statement to update data in the databasebIsInDomain - - are the data objects maintained in domainsstrTableName - - name of the tabledata - - data object to update
java.sql.SQLException - - an error has occured
OSSException - - an error has occured
public static void fetchModifiedTimestamps(MySQLDataUtils.CachedUpdateStatements cache,
ModifiableDataObject data)
throws OSSException
cache - - cached jdbc statementsdata - - data object to update
OSSException - - an error has occured
public static MySQLDataUtils.CachedUpdateStatements cacheStatementsForUpdate(java.sql.Connection dbConnection,
boolean bIsInDomain,
java.lang.String strTableName)
throws OSSException
dbConnection - - connection to the database to usebIsInDomain - - are the data objects maintained in domainsstrTableName - - name of the table
OSSException - - an error accessing the databasepublic static void closeStatements(MySQLDataUtils.CachedUpdateStatements cache)
cache - - cached jdbc statements
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||