planetj.database
Class DataEngine

java.lang.Object
  extended byplanetj.database.DataEngine
All Implemented Interfaces:
IApplicationJSPs, IDataEngine, IJSPPages, INavigation, IServletParameters, IWOWJSPs

public class DataEngine
extends java.lang.Object
implements IDataEngine

The DataEngine provides a framework which can abstractly read, update, and display data from a database. A typical application will access its data with the DataEngine, perform some business logic, and then use the DataEngine to display data in a GUI. You can use one of the getRows() methods to obtain a RowCollection containing data from the database.


Field Summary
static java.lang.String DEFAULT_LOGGING_PATH
          Default path of the logging configuration file.
static java.lang.String LIBRARY_PLACEHOLDER_SYSTEM
          Hardcoded library which represents the WOW system library
static java.lang.String LIBRARY_PLACEHOLDER_USER
          Hardcoded library which represents the WOW user library
 
Fields inherited from interface planetj.dataengine.IDataEngine
ACTION, ADMIN_MAGIC_REQUEST, ALL_SERVLET_PATHS, ALLOW_MULTIPLE_DELETES, ALLOW_MULTIPLE_SELECTION, APPLICATION, COMPANY, CONTEXT, CONTEXT_KEY, CONTROLLER_SERVLET_PATH, CONTROLLER_SERVLET_URI, CURRENT_SQL_CONTEXT, CURRENT_SQL_RECORD_COUNT, CURRENT_SQL_STRING, CURRENT_TOC, DATA_ENGINE_MESSAGE, DATAENGINE_ADMIN_SERVLET_PATH, DATAENGINE_APPLICATION_BUILDER_SERVLET_PATH, DATAENGINE_APPLICATION_SERVLET_PATH, DATAEXPLORER_SERVLET_PATH, DE_ACTION_CATEGORY, DE_ACTION_SIGN_ON, DEFAULT_LAYOUT_DISPLAY_PROPERTIES, DEFAULT_RESULTS_KEY, DETAILS, EDITABLE_OPERATIONS, ENVIRONMENT_MODE_DEVELOPMENT, ENVIRONMENT_MODE_PRODUCTION, ERROR_APPLICATION_INVALID, ERROR_COMPANY_INVALID, ERROR_MESSAGE, ERROR_MESSAGE_NEXT_PAGE, EXCEPTION, EXCEPTION_JSP_KEY, FD_LIBRARY_LIST, FD_TABLE_LIST, FIELD, FIELD_DESCRIPTOR_SERVLET_PATH, FIELD_LIST, FIELD_NAMES, FIELDS, FORM_LIB_TBL_FLD, FUNCTION, HIDDEN_APPLICATION_ID, HIDDEN_APPLICATION_METADATA_ALIAS, HTTP_ATTRIBUTE_LIBRARY_LIST, HTTP_ATTRIBUTE_REPLACEMENT_LIBRARIES, HTTP_ATTRIBUTE_THEME_ID, HTTP_METHOD, HTTP_PARAMETER_LIBRARY_LIST, HTTP_PARAMETER_REPLACEMENT_LIBRARIES, HTTP_PARAMETER_THEME_ID, HTTP_PARAMETER_USER_LIBRARY, HTTP_SAME_NEW_GROUP, IGNORE_MAGIC_REQUEST, KEEP_INSERT_VALUES, LAST_JSP_CALLED, LAUNCHED_FROM_BUILDER, LIBRARY, MAGIC_ACTION_ROW, MODE, MODE_COPY, MODE_DELETE, MODE_EDIT, MODE_INSERT, MODE_INT_COPY, MODE_INT_DELETE, MODE_INT_EDIT, MODE_INT_INSERT, MODE_INT_SEARCH, MODE_INT_UNKNOWN, MODE_INT_VIEW, MODE_SEARCH, MODE_UNKNOWN, MODE_VIEW, MULTIPLESELECTION, NEW_ROW, NEW_WINDOW_FOR_RESULTS, NEXT_PAGE, NO_COOKIES_FLAG, NO_COOKIES_JSP, NOSELECTION, OPERATION, OPERATION_KEY, OWNER_ID, PAGE, PAGE_REQUEST_EXECUTED, PAGE_VALIDATION_REQUIRED, PARAMETER_VALUE_PREFIX, PREVIOUS_PAGE, READ_ONLY_VALUE, RESERVED_PARAMETERS, RETRIEVE_ALL_COLUMNS_ON_COPY, RETRIEVE_ALL_COLUMNS_ON_EDIT, RETRIEVE_ALL_COLUMNS_ON_VIEW, RETRIEVE_FIELDS, RETRIEVE_TABLES, RETURN_URI, ROW, ROW_ALTERNATE_KEY, ROW_COLLECTION, ROW_COLLECTION_KEY, ROW_KEY, ROW_KEY_FOR_DETAILS, ROW_SELECTION_JS_INCLUDED, ROWS_ALTERED_COUNT, SAVED_HTML, SAVED_HTML_KEY, SELECTED_ROW, SELECTED_ROW_COLLECTION, SELECTEDOBJECTS, SERVLET_CONTEXT, SESSION_RANDOM_NUMBER, SESSION_SIGNED_OFF, SESSION_SIGNON_RECEIPT_KEY, SESSION_TIMED_OUT, SHOW_FD_QUICK_LINKS, SHOW_UPDATABLE_TABLES, SHOW_UPDATEABLE_ROW, SIGN_ON_CALLER, SIGNON, SIGNON_AND_REGISTRATION_SERVLET_PATH, SINGLESELECTION, STATEMENT, SYSTEM, SYSTEMS_LIST, TAB_PARENT_ROW_KEY, TABLE, TRANSIENT, UNSUPPORTED, URI_PREFIX, USER_LIBRARY_HTTP_PARAMETER, USER_LIBRARY_HTTP_SESSION_KEY, USER_MESSAGE, USER_PREFERENCES, VALID_SIGNON, WAITING_MAGIC_REQUEST, WAITING_SERVLET, WINDOW_CLOSE, WINDOW_NORMAL, WINDOW_POPUP, WINDOW_TYPE_PARAM
 
Fields inherited from interface planetj.dataengine.INavigation
CHILD_PREFIX, GROUP_ATTRIBUTES, GROUP_ID, INITIAL_GROUP_ID, INITIAL_PAGE_ID, INITIAL_REQUEST_ID, NAVIGATION_CHECKED, NAVIGATION_OBJECT_LIST_PREFIX, NEW_GROUP_ID, NEW_REQUEST_ID, NEW_SESSION_ID, PAGE_ATTRIBUTES, PAGE_ID, PARENT_PREFIX, PERSISTENT_ATTRIBUTES, PREVIOUS_ATTRIBUTES, PREVIOUS_GROUP_ID, PREVIOUS_PAGE_ID, PREVIOUS_REQUEST_ID, REQUEST_ID, RESET_GROUP_ID, RESET_NAVIGATION_IDS, RESET_NAVIGATION_IDS_COMPLETED, RESET_PAGE_ID, RESET_REQUEST_ID, RESET_SESSION_ID, SESSION_ID
 
Fields inherited from interface planetj.dataengine.IServletParameters
ALL, AUTO_RUN, BASE_URL, CACHE_TRACK_ON, CACHE_TRACK_WRITE_TO_FILE, CLEAN_UP_TIME, DATA_ACCESS_TRACKING, DATABASE, DRIVER, ENVIRONMENT_MODE, JDBC_OPTIMIZATIONS, LIBRARY_LIST, MAX_CONNECTIONS, METADATA_LIBRARY, METADATA_USER_LIBRARY, MIN_CONNECTIONS, ORPHAN_TIMEOUT, PASSWORD, PORT, REPLACEMENT_LIBRARIES, SYSTEM_ALIAS, SYSTEM_ALIAS_PARAM, SYSTEM_URL, USER_ID, USER_PASSWORD
 
Fields inherited from interface planetj.dataengine.IJSPPages
CUSTOM_LOG_ON_JSP, DEFAULT_ADD_BODY_JSP, DEFAULT_ADD_BUTTONS_JSP, DEFAULT_EDIT_BODY_JSP, DEFAULT_EDIT_BUTTONS_JSP, DEFAULT_PARAMS_JSP, DEFAULT_PLEASE_WAIT_JSP, DEFAULT_PRINT_PAGE_JSP, DEFAULT_RESULTS_JSP, DEFAULT_ROW_DETAILS, DEFAULT_SQL_OPERATION_RESULTS_JSP, DEFAULT_TAB_CONTAINER_JSP, DEFAULT_TAB_HEADINGS_JSP, DEFAULT_TAB_PARENT_JSP, DEFAULT_VIEW_BODY_JSP, DEFAULT_VIEW_BUTTONS_JSP, DETAILS_JSP, DISPLAY_EXCEPTION_JSP, INITIAL_JSP, PLEASE_WAIT_CONTROLLER_JSP, SIGN_ON_BODY_JSP, SIGN_ON_JSP, SIGNON_PARAMS_JSP
 
Fields inherited from interface planetj.dataengine.application.IApplicationJSPs
APPLICATION_ADD_JSP, APPLICATION_DETAILS_JSP, APPLICATION_EDIT_JSP, APPLICATION_ERROR_JSP, APPLICATION_HEADER_JSP, APPLICATION_INVALID_LICENSE_JSP, APPLICATION_JSP, APPLICATION_MESSAGE_JSP, APPLICATION_OPERATIONS_TOC, APPLICATION_RESULTS_JSP, APPLICATION_SIGN_ON_JSP, APPLICATION_TEMPLATE_JSP, APPLICATION_TOC_JSP, APPLICATION_VIEW_JSP
 
Fields inherited from interface planetj.dataengine.application.IWOWJSPs
WOW_MAIN_EXCEPTION_JSP, WOW_MANAGE_OPERATIONS_JSP, WOW_STEPS_JSP, WOW_TOC, WOW_VIEW_APPLICATIONS_JSP, WOW_VIEW_CONNECTIONS_JSP
 
Constructor Summary
DataEngine()
           
 
Method Summary
static void autoStartConnection(SQLContext context)
          This will ensure that a WOW connection is started.
static void configureLogging(java.lang.String pPath)
          This will configure the logging for Log4J This method must be called before Log4J will begin logging.
static void configureLogging(java.lang.String pPath, java.lang.String pSystemName, java.lang.String pUserId, java.lang.String pPassword)
          Use this method if you are running this java code on a Server that you must signon to.
static int copyRowCollectionToTable(java.sql.Connection connection, Table copyToTable, RowCollection rc)
          This method copies a row collection to the specified table.
static int copyRowCollectionToTable(Table pCopyToTable, RowCollection pRC)
          This method copies a row collection to the specified table.
static boolean createTable(java.sql.Connection pConnection, Table pTable, java.lang.String pCreateTableSQL)
          Creates a database table using the specified information.
static boolean createTable(Table pTable)
          Creates a database table from the specified Table.
static boolean createTable(Table pTable, java.lang.String pCreateTableSQL)
          Creates a database table using the specified information.
static boolean doesTableExist(java.sql.Connection pConnection, Table pTable)
          Returns whether or not a table exists in a database using the specified information.
static boolean doesTableExist(java.sql.Connection pConnection, Table pTable, boolean pUseCaching)
          Returns whether or not a table exists in a database using the specified information.
static boolean doesTableExist(Table pTable)
          Returns whether or not a table exists in a database using the specified information.
static boolean doesTableExist(Table pTable, boolean pUseCaching)
          Returns whether or not a table exists in a database using the specified information.
static void dropTable(java.sql.Connection pConnection, Table pTable)
          Deletes a the given Table from the database.
static void dropTable(Table pTable)
          Deletes a the given Table from the database.
static void execute(SQLContext context)
          Executes an SQL statement, based on a SQLContext.
protected static boolean executeInternal(SQLContext context)
          Executes an SQL statement, based on a SQLContext.
static java.sql.ResultSet executeMetadataQuery(SQLContext context)
          Returns a Result set from metadata.
static java.sql.ResultSet executeQuery(SQLContext context)
          Returns a Result set from executing a query based on the information in the SQLContext.
static int executeUpdate(java.sql.Connection conn, java.lang.String sqlString)
          Returns the number of rows changed from executing the update (of the given sql string) on a Statement from the given Connection.
static int executeUpdate(SQLContext context)
          Updates the database, based on a SQLContext.
static int executeUpdate(java.lang.String pSystemAlias, java.lang.String pSQLString)
          Returns the number of rows changed from executing the update (of the given sql string) on a Statement from the connection created from the given system alias.
protected static int executeUpdateInternal(SQLContext context)
          Updates the database, based on a SQLContext.
static java.lang.String fixSQLMetadataLibrary(java.lang.String sql)
          Deprecated. The SQLContext is now required
static java.lang.String fixSQLMetadataLibrary(java.lang.String sql, SQLContext context)
          Temporary fix so hardcoded queries to the PLANETJ library goto the actual metadata library
static java.util.Map getAllLibraries(DBSystem pSystem)
          Returns a Map of all the Libraries for the specified system alias.
static java.util.Map getAllLibraries(java.lang.String pSystemAlias)
          Deprecated.  
static java.util.Map getAllTables(Library pLibrary)
          Returns a Map of all the Tables for the Library.
static ConnectionRow getDataEngineDefaultConnectionInfo()
          Get a Row containing information for connecting to the DEFAULT connection which can be used to restart the default connection pool.
static java.lang.String getDataEngineKey()
          Returns a key that uniquely identifies this DataEngine.
static java.lang.String getDataEngineLibraryName()
          Gets the library containing DataEngine files
static java.lang.String getDataEngineUserLibraryName()
          Gets the user library containing DataEngine files
static java.lang.String getDefaultMetaDataAlias()
          Gets the default alias of system containing Meta Data (FD's, PV's ect) for DBSystems.
static java.lang.String getEnvironmentMode()
           
static ILicense getLicense()
          Get the license DataEngine is running with.
static ILicense getLicense(boolean checkDefault)
          Get the license DataEngine is running with.
static int getMajorVersion()
           
static int getMaxPreparedStatements()
          Gets the maximum number of prepared statements a single connection can support.
static int getMinorVersion()
           
static java.lang.String getModificationLevel()
           
static int getOperationCount()
           
static java.lang.String getReleaseLevel()
           
static java.util.Map getReplacementLibraries()
           
static java.lang.String getReplacementLibrary(java.lang.String libName)
          Check to see if there is a replacement library for the given library.
static Row getRow(SQLContext context)
          Retrieves the first row from the database based on the criteria in the SQLContext.
static RowCollection getRows(java.sql.Connection conn, java.lang.String sqlString)
          Return a RowCollection using the given Connection and sql String.
static RowCollection getRows(java.sql.Connection conn, java.lang.String sqlString, java.lang.Class rowSubClass)
          Return a RowCollection using the default system Connection.
static RowCollection getRows(SQLContext context)
          Retrieves rows from the database based on the criteria in the SQLContext.
static RowCollection getRows(java.lang.String systemURL, java.lang.String sqlString)
          Return a RowCollection using the default system Connection.
static RowCollection getRows(java.lang.String systemURL, java.lang.String sqlString, java.lang.Class rowSubClass)
          Return a RowCollection using a connection from the specified system url.
protected static RowCollection getRowsInternal(SQLContext context)
          Retrieves rows from the database based on the criteria in the SQLContext.
static int getServicePackLevel()
           
static TaskScheduler getTaskScheduler()
          Returns the TaskScheduler (for the DataEngine) used for scheduling tasks and creating timers.
static java.util.Map getUserLibraryOperationCountMap()
           
static boolean isDataEngineUsingMultiLibraries()
          Return true if multi libraries are being used such as PJSYS60 and PJUSR60.
static boolean isDevelopmentMode()
           
static boolean isLicenseValid()
          Check to see if the current license is valid.
static boolean isMonitoringUsage()
          Insert the method's description here.
static boolean isTrackDataAccess(Table t)
           
static boolean isTrackOperationCount()
           
static void recountOperationsForUserLibrary(java.lang.String userLibrary, java.lang.String system)
           
static java.math.BigDecimal selectColumnSum(Table pTable, java.lang.String pColumnName, java.lang.String pWhereClause)
          This will return a BigDecimal with a value of the total sum of the column specified in pColumnName Creation date: (4/2/2002 1:12:36 PM)
static java.lang.Integer selectRowCount(Table pTable, java.lang.String pWhereClause)
          This will return an Integer with a value of the total number of rows in pTable Creation date: (4/2/2002 1:12:36 PM)
static void setDataEngineDefaultConnectionInfo(ConnectionRow connInfoRow)
          Set a Row containing information for connecting to the DEFAULT connection which can later be used to restart the default connection pool.
static void setDataEngineLibraryName(java.lang.String libName)
          Sets the library containing DataEngine files
static void setDataEngineUserLibraryName(java.lang.String libName)
          Sets the user library containing DataEngine files
static void setDefaultMetaDataAlias(java.lang.String pDefaultMetaDataAlias)
          Sets the default alias of system containing Meta Data (FD's, PV's ect) for DBSystems.
static void setEnvironmentMode(java.lang.String mode)
           
static void setLicense(ILicense license)
          Set the license DataEngine should use when running
static void setMaxPreparedStatements(int newMaxPreparedStatements)
          Sets the maximum number of prepared statements a single connection can support.
static void setMonitoringUsage(boolean newMonitoringUsage)
          Insert the method's description here.
static void setReplacementLibraries(java.util.Map replacements)
           
static void setTrackDataAccessOff()
           
static void setTrackDataAccessOn()
           
static void setTrackOperationCount(boolean turnOn)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIBRARY_PLACEHOLDER_SYSTEM

public static final java.lang.String LIBRARY_PLACEHOLDER_SYSTEM
Hardcoded library which represents the WOW system library

See Also:
Constant Field Values

LIBRARY_PLACEHOLDER_USER

public static final java.lang.String LIBRARY_PLACEHOLDER_USER
Hardcoded library which represents the WOW user library

See Also:
Constant Field Values

DEFAULT_LOGGING_PATH

public static final java.lang.String DEFAULT_LOGGING_PATH
Default path of the logging configuration file.

See Also:
Constant Field Values
Constructor Detail

DataEngine

public DataEngine()
Method Detail

autoStartConnection

public static void autoStartConnection(SQLContext context)
This will ensure that a WOW connection is started. Creation date: (9/28/2004)


configureLogging

public static void configureLogging(java.lang.String pPath)
This will configure the logging for Log4J This method must be called before Log4J will begin logging. Creation date: (2/4/2002 2:54:24 PM)


configureLogging

public static void configureLogging(java.lang.String pPath,
                                    java.lang.String pSystemName,
                                    java.lang.String pUserId,
                                    java.lang.String pPassword)
Use this method if you are running this java code on a Server that you must signon to. If this code is running on AS400, you must configureLogging with this method and supply all parameters. This will configure the logging for Log4J This method must be called before Log4J will begin logging. Creation date: (2/4/2002 2:54:24 PM)


copyRowCollectionToTable

public static int copyRowCollectionToTable(java.sql.Connection connection,
                                           Table copyToTable,
                                           RowCollection rc)
                                    throws CMException
This method copies a row collection to the specified table. The number of rows copied is returned

Throws:
CMException

copyRowCollectionToTable

public static int copyRowCollectionToTable(Table pCopyToTable,
                                           RowCollection pRC)
                                    throws CMException
This method copies a row collection to the specified table.

Parameters:
pCopyToTable - Table
pRC - RowCollection
Throws:
CMException

createTable

public static boolean createTable(java.sql.Connection pConnection,
                                  Table pTable,
                                  java.lang.String pCreateTableSQL)
                           throws CMException
Creates a database table using the specified information.

Parameters:
pConnection - connection to create the table using
Returns:
boolean
Throws:
CMException

createTable

public static boolean createTable(Table pTable)
                           throws CMException
Creates a database table from the specified Table.

Parameters:
pTable - Table to create database table from.
Returns:
boolean Whether or not create table succeeded (if table already exists, false is returned).
Throws:
CMException

createTable

public static boolean createTable(Table pTable,
                                  java.lang.String pCreateTableSQL)
                           throws CMException
Creates a database table using the specified information.

Parameters:
pTable - Table
Throws:
CMException

doesTableExist

public static boolean doesTableExist(java.sql.Connection pConnection,
                                     Table pTable)
                              throws CMException
Returns whether or not a table exists in a database using the specified information. This method assumes that caching is used.

********************** **NOTE** This method is expensive to call. Please ensure it is never called in a loop or when not necessary, JProbe results found these poor results about this method: Cumulative Time: 13 seconds **********************

Parameters:
pTable - Table
Returns:
boolean
Throws:
CMException

doesTableExist

public static boolean doesTableExist(java.sql.Connection pConnection,
                                     Table pTable,
                                     boolean pUseCaching)
                              throws CMException
Returns whether or not a table exists in a database using the specified information.

********************** **NOTE** This method is expensive to call. Please ensure it is never called in a loop or when not necessary, JProbe results found these poor results about this method: Cumulative Time: 13 seconds **********************

Parameters:
pConnection - Connection
pTable - Table
pUseCaching - boolean
Returns:
boolean
Throws:
CMException

doesTableExist

public static boolean doesTableExist(Table pTable)
                              throws CMException
Returns whether or not a table exists in a database using the specified information. This method assumes that caching will be used.

Parameters:
pTable - Table
Returns:
boolean
Throws:
CMException

doesTableExist

public static boolean doesTableExist(Table pTable,
                                     boolean pUseCaching)
                              throws CMException
Returns whether or not a table exists in a database using the specified information.

Parameters:
pTable - Table
pUseCaching - boolean
Returns:
boolean
Throws:
CMException

dropTable

public static void dropTable(java.sql.Connection pConnection,
                             Table pTable)
                      throws CMException
Deletes a the given Table from the database.

Parameters:
pConnection - connection to the database
pTable - Table to delete from database
Throws:
CMException

dropTable

public static void dropTable(Table pTable)
                      throws CMException
Deletes a the given Table from the database.

Parameters:
pTable - Table to delete from database
Throws:
CMException

execute

public static void execute(SQLContext context)
                    throws CMException
Executes an SQL statement, based on a SQLContext. The SQL statement cannot return any information.

Throws:
CMException

executeInternal

protected static boolean executeInternal(SQLContext context)
                                  throws CMException
Executes an SQL statement, based on a SQLContext. The SQL statement cannot return any data.

Throws:
CMException

executeMetadataQuery

public static java.sql.ResultSet executeMetadataQuery(SQLContext context)
                                               throws CMException
Returns a Result set from metadata.

Throws:
CMException

executeQuery

public static java.sql.ResultSet executeQuery(SQLContext context)
                                       throws DataEngineException
Returns a Result set from executing a query based on the information in the SQLContext. Although this method can be invoked externally, it is recommended that you use the getRows() method instead. If this method is invoked directly, many of the DataEngine options (such as the cache system and notifying the SQLListeners) are ignored.

Throws:
DataEngineException

executeUpdate

public static int executeUpdate(java.lang.String pSystemAlias,
                                java.lang.String pSQLString)
                         throws CMException
Returns the number of rows changed from executing the update (of the given sql string) on a Statement from the connection created from the given system alias.

Parameters:
pSystemAlias - String
pSQLString - String
Returns:
int
Throws:
CMException

executeUpdate

public static int executeUpdate(java.sql.Connection conn,
                                java.lang.String sqlString)
                         throws CMException
Returns the number of rows changed from executing the update (of the given sql string) on a Statement from the given Connection.

Parameters:
sqlString - String
conn - Connection
Returns:
int
Throws:
CMException

executeUpdate

public static int executeUpdate(SQLContext context)
                         throws CMException
Updates the database, based on a SQLContext.

Returns:
The number of rows altered are returned, unless the runInBackground property is true. In that case, this method returns -1 immediately, and any listeners are informed when the update is complete. *
Throws:
CMException

executeUpdateInternal

protected static int executeUpdateInternal(SQLContext context)
                                    throws CMException
Updates the database, based on a SQLContext. The number of rows altered are returned.

Throws:
CMException

fixSQLMetadataLibrary

public static final java.lang.String fixSQLMetadataLibrary(java.lang.String sql)
Deprecated. The SQLContext is now required

Temporary fix so hardcoded queries to the PLANETJ library goto the actual metadata library


fixSQLMetadataLibrary

public static final java.lang.String fixSQLMetadataLibrary(java.lang.String sql,
                                                           SQLContext context)
Temporary fix so hardcoded queries to the PLANETJ library goto the actual metadata library


getReplacementLibrary

public static final java.lang.String getReplacementLibrary(java.lang.String libName)
Check to see if there is a replacement library for the given library.


getAllLibraries

public static java.util.Map getAllLibraries(java.lang.String pSystemAlias)
                                     throws DataEngineException
Deprecated.  

Returns a Map of all the Libraries for the specified system alias. This method will goto the database every time. The getAllLibraries() method of DBSystem will only goto the database the first time, and will return all the cached libraries from subsequent invocations.

Parameters:
pSystemAlias - The alias of the DBSystem whose libraries will be retrieved
Returns:
A Map whose keys are the names of the libraries in the DBSystem and whose values are Library objects
Throws:
DataEngineException

getAllLibraries

public static java.util.Map getAllLibraries(DBSystem pSystem)
                                     throws DataEngineException
Returns a Map of all the Libraries for the specified system alias. This method will goto the database every time. The getAllLibraries() method of DBSystem will only goto the database the first time, and will return all the cached libraries from subsequent invocations.

Returns:
A Map whose keys are the names of the libraries in the DBSystem and whose values are Library objects
Throws:
DataEngineException

getAllTables

public static java.util.Map getAllTables(Library pLibrary)
                                  throws DataEngineException
Returns a Map of all the Tables for the Library.

Parameters:
pLibrary - Library
Returns:
Map
Throws:
DataEngineException

getDataEngineKey

public static final java.lang.String getDataEngineKey()
Returns a key that uniquely identifies this DataEngine. This key will be used by the license when it is created to match it to the DataEngine.

Returns:
String

getDataEngineDefaultConnectionInfo

public static final ConnectionRow getDataEngineDefaultConnectionInfo()
Get a Row containing information for connecting to the DEFAULT connection which can be used to restart the default connection pool.


getDataEngineLibraryName

public static final java.lang.String getDataEngineLibraryName()
Gets the library containing DataEngine files


getDataEngineUserLibraryName

public static final java.lang.String getDataEngineUserLibraryName()
Gets the user library containing DataEngine files


getDefaultMetaDataAlias

public static java.lang.String getDefaultMetaDataAlias()
Gets the default alias of system containing Meta Data (FD's, PV's ect) for DBSystems.

Returns:
String

getLicense

public static ILicense getLicense()
                           throws CMException
Get the license DataEngine is running with. If no license exists, the default location is checked.

Returns:
license DataEngine is running with
Throws:
CMException

getLicense

public static ILicense getLicense(boolean checkDefault)
                           throws CMException
Get the license DataEngine is running with. If no license exists, the default location is checked if specified.

Returns:
license DataEngine is running with
Throws:
CMException

setLicense

public static void setLicense(ILicense license)
Set the license DataEngine should use when running

Parameters:
license - new license to run with

getMaxPreparedStatements

public static int getMaxPreparedStatements()
Gets the maximum number of prepared statements a single connection can support. The default is 20. Each prepared statement takes up resources; therefore the maximum number should be limited. Note that this limit is per connection, the total number of prepared statements may be higher. This value should be set before any of the connections are used.


getMajorVersion

public static int getMajorVersion()

getMinorVersion

public static int getMinorVersion()

getServicePackLevel

public static int getServicePackLevel()

getModificationLevel

public static java.lang.String getModificationLevel()
Returns:

getReleaseLevel

public static java.lang.String getReleaseLevel()

getReplacementLibraries

public static java.util.Map getReplacementLibraries()
Returns:

isTrackOperationCount

public static boolean isTrackOperationCount()

getUserLibraryOperationCountMap

public static java.util.Map getUserLibraryOperationCountMap()

getOperationCount

public static int getOperationCount()

recountOperationsForUserLibrary

public static void recountOperationsForUserLibrary(java.lang.String userLibrary,
                                                   java.lang.String system)

getRow

public static Row getRow(SQLContext context)
                  throws CMException
Retrieves the first row from the database based on the criteria in the SQLContext.

Parameters:
context - A SQLContext containing information necessary to retrieve rows from a database.
Returns:
A Row object containing the rows specified in the SQLContext. Return null if no row is found.
Throws:
CMException

getRows

public static RowCollection getRows(java.lang.String systemURL,
                                    java.lang.String sqlString)
                             throws CMException
Return a RowCollection using the default system Connection.

Parameters:
sqlString - String
Returns:
RowCollection
Throws:
CMException

getRows

public static RowCollection getRows(java.lang.String systemURL,
                                    java.lang.String sqlString,
                                    java.lang.Class rowSubClass)
                             throws CMException
Return a RowCollection using a connection from the specified system url.

Parameters:
systemURL - String
sqlString - String
rowSubClass - Class
Returns:
RowCollection
Throws:
CMException

getRows

public static RowCollection getRows(java.sql.Connection conn,
                                    java.lang.String sqlString)
                             throws CMException
Return a RowCollection using the given Connection and sql String.

Parameters:
conn - Connection
sqlString - String
Returns:
RowCollection
Throws:
CMException

getRows

public static RowCollection getRows(java.sql.Connection conn,
                                    java.lang.String sqlString,
                                    java.lang.Class rowSubClass)
                             throws CMException
Return a RowCollection using the default system Connection.

Parameters:
conn - Connection
sqlString - String
rowSubClass - Class
Returns:
RowCollection
Throws:
CMException

getRows

public static RowCollection getRows(SQLContext context)
                             throws CMException
Retrieves rows from the database based on the criteria in the SQLContext. If the SQLContext specifies that the query should run in the background, then this method will return null immediately. Otherwise, it won't return until a result is obtained.

Parameters:
context - A SQLContext containing information necessary to retrieve rows from a database.
Returns:
A RowCollection object containing the rows specified in the SQLContext, unless the query is running in the background, in which case null is returned.
Throws:
CMException

getRowsInternal

protected static RowCollection getRowsInternal(SQLContext context)
                                        throws CMException
Retrieves rows from the database based on the criteria in the SQLContext.

Parameters:
context - A SQLContext containing information necessary to retrieve rows from a database.
Returns:
A RowCollection object containing the rows specified in the SQLContext.
Throws:
CMException

getTaskScheduler

public static TaskScheduler getTaskScheduler()
Returns the TaskScheduler (for the DataEngine) used for scheduling tasks and creating timers.

Returns:
The TaskScheduler used for creating timers and scheduling tasks.

isDataEngineUsingMultiLibraries

public static final boolean isDataEngineUsingMultiLibraries()
Return true if multi libraries are being used such as PJSYS60 and PJUSR60. The old scheme is a single library called PlanetJ.


isLicenseValid

public static boolean isLicenseValid()
Check to see if the current license is valid.

Returns:
true if license is valid.

isMonitoringUsage

public static boolean isMonitoringUsage()
Insert the method's description here. Creation date: (12/17/01 9:27:09 AM)

Returns:
boolean

isTrackDataAccess

public static boolean isTrackDataAccess(Table t)

selectColumnSum

public static java.math.BigDecimal selectColumnSum(Table pTable,
                                                   java.lang.String pColumnName,
                                                   java.lang.String pWhereClause)
This will return a BigDecimal with a value of the total sum of the column specified in pColumnName Creation date: (4/2/2002 1:12:36 PM)


selectRowCount

public static java.lang.Integer selectRowCount(Table pTable,
                                               java.lang.String pWhereClause)
This will return an Integer with a value of the total number of rows in pTable Creation date: (4/2/2002 1:12:36 PM)


setDataEngineDefaultConnectionInfo

public static final void setDataEngineDefaultConnectionInfo(ConnectionRow connInfoRow)
Set a Row containing information for connecting to the DEFAULT connection which can later be used to restart the default connection pool. NOTE: this method should only be called once when the DEFAULT connection pool is initialized when the DataEngineServlet is initialized.


setDataEngineLibraryName

public static final void setDataEngineLibraryName(java.lang.String libName)
Sets the library containing DataEngine files


setDataEngineUserLibraryName

public static final void setDataEngineUserLibraryName(java.lang.String libName)
Sets the user library containing DataEngine files


setDefaultMetaDataAlias

public static void setDefaultMetaDataAlias(java.lang.String pDefaultMetaDataAlias)
Sets the default alias of system containing Meta Data (FD's, PV's ect) for DBSystems.

Parameters:
pDefaultMetaDataAlias - String

setMaxPreparedStatements

public static void setMaxPreparedStatements(int newMaxPreparedStatements)
Sets the maximum number of prepared statements a single connection can support. The default is 20. Each prepared statement takes up resources; therefore the maximum number should be limited. Note that this limit is per connection, the total number of prepared statements may be higher. This value should be set before any of the connections are used.


setMonitoringUsage

public static void setMonitoringUsage(boolean newMonitoringUsage)
Insert the method's description here. Creation date: (12/17/01 9:27:09 AM)

Parameters:
newMonitoringUsage - boolean

setReplacementLibraries

public static void setReplacementLibraries(java.util.Map replacements)

setTrackDataAccessOff

public static void setTrackDataAccessOff()

setTrackDataAccessOn

public static void setTrackDataAccessOn()

setTrackOperationCount

public static void setTrackOperationCount(boolean turnOn)

isDevelopmentMode

public static boolean isDevelopmentMode()
Returns:

getEnvironmentMode

public static java.lang.String getEnvironmentMode()
Returns:

setEnvironmentMode

public static void setEnvironmentMode(java.lang.String mode)