|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensubsystems.core.persist.db.DatabaseImpl
org.opensubsystems.core.persist.db.sapdb.SapDBDatabaseImpl
public class SapDBDatabaseImpl
Management layer for SAP DB database (www.sapdb.org)
| Field Summary |
|---|
| Fields inherited from class org.opensubsystems.core.persist.db.DatabaseImpl |
|---|
m_bDatabaseSchemaInitialized, m_bDatabaseStarted, m_bDatabaseStartInProgress, m_vdsSchema, MAX_SAFE_LENGTH |
| Constructor Summary | |
|---|---|
SapDBDatabaseImpl()
Default constructor for empty database. |
|
| Method Summary | |
|---|---|
void |
createDatabaseInstance()
Method for creating database instance. |
protected void |
createUser(java.sql.Connection cntAdminDBConnection)
Create database user which will be used by connection pool to access the database. |
java.lang.String |
getCurrentTimestampFunctionCall()
Get string which can be used in SQL queries to retrieve timestamp representing current time. |
protected java.lang.String |
getDatabaseHost(java.lang.String strDatabaseURL)
Returns the database host name. |
protected java.lang.String |
getDatabaseName(java.lang.String strDatabaseURL)
Returns the database name. |
int |
getDatabaseType()
Returns the type of database currently in use. |
java.lang.String |
getDatabaseTypeIdentifier()
Returns the identifier for the type of database currently in use which can be used to construct package and class names. |
java.lang.Object[] |
getSQLAnalyzeFunctionCall(java.util.Map mapTableNames)
Get DB specific SQL queries for analyzing tables or updating statistics on the tables (it is good for performance). |
java.lang.String |
getSQLCountFunctionCall()
Get string which can be used in SQL queries to retrieve record count. |
void |
insertAndFetchGeneratedValues(java.sql.Connection dbConnection,
java.sql.PreparedStatement insertStatement,
boolean bIsInDomain,
java.lang.String strTableName,
int iIndex,
BasicDataObject data)
Insert the data, fetch from the database id and generated creation and optionally modification timestamps for the newly created data object. |
boolean |
isCallableStatement(java.lang.String strQuery)
Test if the specified query invokes stored procedure or if it is just a regular prepared statement. |
boolean |
preferCountToLast()
Find out if when trying to find out size of the result set we should use rather count(*)/count(1)/count(id) instead of using hasAbsolutePositioningSupport. |
void |
startDatabaseServer()
Method for starting database instance. |
void |
stop()
Stop the database. After the database is stopped, no more requests can be issued until the database is started again. |
void |
updatedAndFetchGeneratedValues(java.lang.String strDataName,
java.sql.Connection dbConnection,
java.sql.PreparedStatement updateStatement,
boolean bIsInDomain,
java.lang.String strTableName,
int iIndex,
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 org.opensubsystems.core.persist.db.DatabaseImpl |
|---|
add, add, getAdminConnection, getConnectionTestStatement, getInstance, getInstanceIfStarted, getSelectListResultSetConcurrency, getSelectListResultSetType, getTransactionIsolation, hasAbsolutePositioningSupport, hasSelectListRangeSupport, isStarted, setInstance, start |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SapDBDatabaseImpl()
throws OSSException
OSSException - - problem connecting to database| Method Detail |
|---|
protected void createUser(java.sql.Connection cntAdminDBConnection)
throws OSSException
createUser in class DatabaseImplcntAdminDBConnection - - connection with rights to create users
OSSException - - cannot create user
public void startDatabaseServer()
throws OSSException
startDatabaseServer in class DatabaseImplOSSException - - problem starting the server
public void createDatabaseInstance()
throws OSSException
createDatabaseInstance in class DatabaseImplOSSException - - problem creating the database instancepublic int getDatabaseType()
public java.lang.String getDatabaseTypeIdentifier()
protected java.lang.String getDatabaseHost(java.lang.String strDatabaseURL)
strDatabaseURL - - The database URL the host name to be parsed from
protected java.lang.String getDatabaseName(java.lang.String strDatabaseURL)
strDatabaseURL - - The database URL the name to be parsed from
public void stop()
throws OSSException
stop in interface Databasestop in class DatabaseImplOSSException - - problems stopping the databasepublic boolean preferCountToLast()
preferCountToLast in interface DatabasepreferCountToLast in class DatabaseImplpublic java.lang.String getCurrentTimestampFunctionCall()
public java.lang.String getSQLCountFunctionCall()
public java.lang.Object[] getSQLAnalyzeFunctionCall(java.util.Map mapTableNames)
mapTableNames - - map of table names the update statistics will be
processed on. Key is the data object data of which
are stored in the table and value is te name of the
table
public boolean isCallableStatement(java.lang.String strQuery)
strQuery - - query to test
public void insertAndFetchGeneratedValues(java.sql.Connection dbConnection,
java.sql.PreparedStatement insertStatement,
boolean bIsInDomain,
java.lang.String strTableName,
int iIndex,
BasicDataObject data)
throws java.sql.SQLException,
OSSException
dbConnection - - connection to use to access the databaseinsertStatement - - statement used to insert the data. This can be
CallableStatement if stored procedure is used.bIsInDomain - - are the data objects maintained in domainsstrTableName - - name of the table where the data are being insertediIndex - - 1 based index of the next parameter value of which can be
set on the statement (last parameter set by caller + 1)data - - data object to update with the fetched values
java.sql.SQLException - - an error has occured
OSSException - - an error has occured
public void updatedAndFetchGeneratedValues(java.lang.String strDataName,
java.sql.Connection dbConnection,
java.sql.PreparedStatement updateStatement,
boolean bIsInDomain,
java.lang.String strTableName,
int iIndex,
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 database. This
can be CallableStatement if stored procedure is
used.bIsInDomain - - are the data objects maintained in domainsstrTableName - - name of the tableiIndex - - 1 based index of the next parameter value of which can be
set on the statement (last parameter set by caller + 1)data - - data object to update
java.sql.SQLException - - an error has occured
OSSException - - an error has occured
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||