|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--planetj.database.DataEngine
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 String |
DEFAULT_LOGGING_PATH
Default path of the logging configuration file. |
static String |
LIBRARY_PLACEHOLDER_SYSTEM
Hardcoded library which represents the WOW system library |
static String |
LIBRARY_PLACEHOLDER_USER
Hardcoded library which represents the WOW user library |
Fields inherited from interface planetj.dataengine.IServletParameters |
ALL, AUTO_RUN, BASE_URL, CACHE_TRACK_ON, CACHE_TRACK_WRITE_TO_FILE, CLEAN_UP_TIME, DATABASE, DRIVER, ENVIRONMENT_MODE, JDBC_OPTIMIZATIONS, MAX_CONNECTIONS, METADATA_LIBRARY, MIN_CONNECTIONS, ORPHAN_TIMEOUT, PASSWORD, PORT, 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_EDIT_BODY_JSP, DEFAULT_PARAMS_JSP, DEFAULT_PRINT_PAGE_JSP, DEFAULT_RESULTS_JSP, DEFAULT_ROW_DETAILS, DEFAULT_SQL_OPERATION_RESULTS_JSP, DEFAULT_VIEW_BODY_JSP, DETAILS_JSP, DISPLAY_EXCEPTION_JSP, INITIAL_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 |
configureLogging(String pPath)
This will configure the logging for Log4J This method must be called before Log4J will begin logging. |
static void |
configureLogging(String pPath,
String pSystemName,
String pUserId,
String pPassword)
Use this method if you are running this java code on a Server that you must signon to. |
static void |
copyRowCollectionToTable(Connection connection,
Table copyToTable,
RowCollection rc)
This method copies a row collection to the specified table. |
static void |
copyRowCollectionToTable(Table pCopyToTable,
RowCollection pRC)
This method copies a row collection to the specified table. |
static boolean |
createTable(Connection pConnection,
Table pTable,
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,
String pCreateTableSQL)
Creates a database table using the specified information. |
static boolean |
doesTableExist(Connection pConnection,
Table pTable)
Returns whether or not a table exists in a database using the specified information. |
static boolean |
doesTableExist(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(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 . |
static ResultSet |
executeQuery(SQLContext context)
Returns a Result set from executing a query based on the information in the SQLContext. |
static int |
executeUpdate(Connection conn,
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(String pSystemAlias,
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. |
static String |
fixSQLMetadataLibrary(String sql)
Deprecated. The SQLContext is now required |
static String |
fixSQLMetadataLibrary(String sql,
SQLContext context)
Temporary fix so hardcoded queries to the PLANETJ library goto the actual metadata library |
static Map |
getAllLibraries(DBSystem pSystem)
Returns a Map of all the Libraries for the specified system alias. |
static Map |
getAllLibraries(String pSystemAlias)
Deprecated. |
static Map |
getAllTables(Library pLibrary)
Returns a Map of all the Tables for the Library. |
static String |
getDataEngineKey()
Returns a key that uniquely identifies this DataEngine. |
static String |
getDataEngineLibraryName()
Gets the library containing DataEngine files |
static String |
getDefaultMetaDataAlias()
Gets the default alias of system containing Meta Data (FD's, PV's ect) for DBSystems. |
static 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 |
getMaxPreparedStatements()
Gets the maximum number of prepared statements a single connection can support. |
static String |
getModificationLevel()
|
static String |
getReleaseLevel()
|
static Row |
getRow(SQLContext context)
Retrieves the first row from the database based on the criteria in the SQLContext. |
static RowCollection |
getRows(Connection conn,
String sqlString)
Return a RowCollection using the given Connection and sql String. |
static RowCollection |
getRows(Connection conn,
String sqlString,
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(String systemURL,
String sqlString)
Return a RowCollection using the default system Connection. |
static RowCollection |
getRows(String systemURL,
String sqlString,
Class rowSubClass)
Return a RowCollection using a connection from the specified system url. |
static TaskScheduler |
getTaskScheduler()
Returns the TaskScheduler (for the DataEngine) used for scheduling tasks and creating timers. |
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 BigDecimal |
selectColumnSum(Table pTable,
String pColumnName,
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 Integer |
selectRowCount(Table pTable,
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 |
setDataEngineLibraryName(String libName)
Sets the library containing DataEngine files |
static void |
setDefaultMetaDataAlias(String pDefaultMetaDataAlias)
Sets the default alias of system containing Meta Data (FD's, PV's ect) for DBSystems. |
static void |
setEnvironmentMode(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. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String LIBRARY_PLACEHOLDER_SYSTEM
public static final String LIBRARY_PLACEHOLDER_USER
public static final String DEFAULT_LOGGING_PATH
Constructor Detail |
public DataEngine()
Method Detail |
public static void configureLogging(String pPath)
public static void configureLogging(String pPath, String pSystemName, String pUserId, String pPassword)
public static void copyRowCollectionToTable(Connection connection, Table copyToTable, RowCollection rc) throws CMException
CMException
public static void copyRowCollectionToTable(Table pCopyToTable, RowCollection pRC) throws CMException
pCopyToTable
- TablepRC
- RowCollection
CMException
public static boolean createTable(Connection pConnection, Table pTable, String pCreateTableSQL) throws CMException
pConnection
- connection to create the table using
CMException
public static boolean createTable(Table pTable) throws CMException
pTable
- Table to create database table from.
CMException
public static boolean createTable(Table pTable, String pCreateTableSQL) throws CMException
pTable
- Table
CMException
public static boolean doesTableExist(Connection pConnection, Table pTable) throws CMException
**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
pTable
- Table
CMException
public static boolean doesTableExist(Connection pConnection, Table pTable, boolean pUseCaching) throws CMException
**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
pConnection
- ConnectionpTable
- TablepUseCaching
- boolean
CMException
public static boolean doesTableExist(Table pTable) throws CMException
pTable
- Table
CMException
public static boolean doesTableExist(Table pTable, boolean pUseCaching) throws CMException
pTable
- TablepUseCaching
- boolean
CMException
public static void dropTable(Connection pConnection, Table pTable) throws CMException
pConnection
- connection to the databasepTable
- Table to delete from database
CMException
public static void dropTable(Table pTable) throws CMException
pTable
- Table to delete from database
CMException
public static void execute(SQLContext context) throws CMException
SQLContext
. The SQL statement cannot return any
information.
CMException
public static ResultSet executeQuery(SQLContext context) throws DataEngineException
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.
DataEngineException
public static int executeUpdate(String pSystemAlias, String pSQLString) throws CMException
pSystemAlias
- StringpSQLString
- String
CMException
public static int executeUpdate(Connection conn, String sqlString) throws CMException
sqlString
- Stringconn
- Connection
CMException
public static int executeUpdate(SQLContext context) throws CMException
CMException
public static final String fixSQLMetadataLibrary(String sql)
public static final String fixSQLMetadataLibrary(String sql, SQLContext context)
public static Map getAllLibraries(String pSystemAlias) throws DataEngineException
getAllLibraries()
method of DBSystem will only goto
the database the first time, and will return all the cached libraries from subsequent invocations.
pSystemAlias
- The alias of the DBSystem whose libraries will be retrieved
DataEngineException
public static Map getAllLibraries(DBSystem pSystem) throws DataEngineException
getAllLibraries()
method of DBSystem will only goto
the database the first time, and will return all the cached libraries from subsequent invocations.
DataEngineException
public static Map getAllTables(Library pLibrary) throws DataEngineException
pLibrary
- Library
DataEngineException
public static final String getDataEngineKey()
public static final String getDataEngineLibraryName()
public static String getDefaultMetaDataAlias()
public static ILicense getLicense() throws CMException
CMException
public static ILicense getLicense(boolean checkDefault) throws CMException
CMException
public static void setLicense(ILicense license)
license
- new license to run withpublic static int getMaxPreparedStatements()
public static String getModificationLevel()
public static String getReleaseLevel()
public static Row getRow(SQLContext context) throws CMException
context
- A SQLContext containing information necessary to retrieve rows from a database.
CMException
public static RowCollection getRows(String systemURL, String sqlString) throws CMException
sqlString
- String
CMException
public static RowCollection getRows(String systemURL, String sqlString, Class rowSubClass) throws CMException
systemURL
- StringsqlString
- StringrowSubClass
- Class
CMException
public static RowCollection getRows(Connection conn, String sqlString) throws CMException
conn
- ConnectionsqlString
- String
CMException
public static RowCollection getRows(Connection conn, String sqlString, Class rowSubClass) throws CMException
conn
- ConnectionsqlString
- StringrowSubClass
- Class
CMException
public static RowCollection getRows(SQLContext context) throws CMException
background
, then this method
will return null immediately. Otherwise, it won't return until a result is obtained.
context
- A SQLContext containing information necessary to retrieve rows from a database.
CMException
public static TaskScheduler getTaskScheduler()
public static final boolean isDataEngineUsingMultiLibraries()
public static boolean isLicenseValid()
public static boolean isMonitoringUsage()
public static BigDecimal selectColumnSum(Table pTable, String pColumnName, String pWhereClause)
public static Integer selectRowCount(Table pTable, String pWhereClause)
public static final void setDataEngineLibraryName(String libName)
public static void setDefaultMetaDataAlias(String pDefaultMetaDataAlias)
pDefaultMetaDataAlias
- Stringpublic static void setMaxPreparedStatements(int newMaxPreparedStatements)
public static void setMonitoringUsage(boolean newMonitoringUsage)
newMonitoringUsage
- booleanpublic static boolean isDevelopmentMode()
public static String getEnvironmentMode()
public static void setEnvironmentMode(String mode)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |