Inheritance diagram for org.openmobileis.common.util.database.AbstractQueryManager:
A query is built with : A pattern : SQL query with variables Parameters : Values of the variables defined in the pattern For instance, the query "SELECT * FROM TABLE WHERE ROW1 = val1 AND ROW2 = val2 will have the following pattern : "SELECT * FROM TABLE WHERE ROW1 = %0% AND ROW2 = %1% and the following parameters : {"val1", "val2"}. Note that the name of the variables are a sequential number starting by 0 and inserted between two separators : % The Manager variable contains dbManager instance which provides services to be connected / disconnected to the database as well as a service to get a connection from the pool connection object.
Definition at line 52 of file AbstractQueryManager.java.
Public Member Functions | |
AbstractQueryManager () | |
void | registerManagerDB (ManagerDB manager) |
void | close () |
close() allows to close the database | |
ManagerDB | getDbManager () |
Returns the dbManager. | |
Protected Member Functions | |
void | executeBlobUpdate (String queryPattern, String parameters[], byte[][] blobs) throws DatabaseException |
execute insert or update query with Blob data. | |
ResultSet | executeQuery (String queryPattern, String parameters[]) throws DatabaseException |
executeQuery() allows to execute a query such as "SELECT * FROM TABLE") use SQL syntax to perform queries Connection is not close to keep the resulting resultset. | |
ResultSet | executeDynamicQuery (String queryPattern, java.util.Hashtable variables) throws DatabaseException |
executeQuery() allows to execute a query such as "SELECT * FROM TABLE") use SQL syntax to perform queries Connection is not close to keep the resulting resultset. | |
void | executeUpdate (String queryPattern, String parameters[]) throws DatabaseException |
executeUpdateQuery() allows to execute a query with INSERT, UPDATE or DELETE statements use SQL syntax to perform queries | |
void | executeDynamicUpdate (String queryPattern, java.util.Hashtable variables) throws DatabaseException |
executeUpdateQuery() allows to execute a query with INSERT, UPDATE or DELETE statements use SQL syntax to perform queries Connection is not close to keep the resulting resultset. | |
String | buildDynamicQuery (String pattern, java.util.Hashtable variables) |
String | buildQuery (String queryPattern, String parameters[]) throws DatabaseException |
buildQuery() get the query pattern stored in queries and insert the parameters. | |
String | makeSQLList (String[] items) |
Static Package Attributes | |
static char | Separator = '%' |
void org.openmobileis.common.util.database.AbstractQueryManager.close | ( | ) |
close() allows to close the database
None |
None |
Definition at line 87 of file AbstractQueryManager.java.
void org.openmobileis.common.util.database.AbstractQueryManager.executeBlobUpdate | ( | String | queryPattern, | |
String | parameters[], | |||
byte | blobs[][] | |||
) | throws DatabaseException [protected] |
execute insert or update query with Blob data.
Query parameters are indicated with 0% tag and blob data with ? tag. Use SQL syntax to perform queries
String | representing the query with parameters in tag | |
query | parameters. | |
blob | data. |
DatabaseException |
Definition at line 104 of file AbstractQueryManager.java.
ResultSet org.openmobileis.common.util.database.AbstractQueryManager.executeQuery | ( | String | queryPattern, | |
String | parameters[] | |||
) | throws DatabaseException [protected] |
executeQuery() allows to execute a query such as "SELECT * FROM TABLE") use SQL syntax to perform queries Connection is not close to keep the resulting resultset.
It must be garbaged by calling ManagerDB.getManager().garbageOpenedConnection();;
String | representing the query | |
query | parameters. |
SQLException |
Definition at line 138 of file AbstractQueryManager.java.
Referenced by org.openmobileis.examples.server.database.JDBCBaseDataFactory.getAllBaseData(), org.openmobileis.synchro.algo.replication.utils.impl.PostgreSQLAtomicObjectQueryManager.getAllModifiedAtomicObjectForServiceSince(), org.openmobileis.synchro.algo.replication.utils.impl.OracleAtomicObjectQueryManager.getAllModifiedAtomicObjectForServiceSince(), org.openmobileis.synchro.algo.replication.utils.impl.MSSQLAtomicObjectQueryManager.getAllModifiedAtomicObjectForServiceSince(), org.openmobileis.synchro.algo.replication.utils.impl.HSQLAtomicObjectQueryManager.getAllModifiedAtomicObjectForServiceSince(), org.openmobileis.synchro.algo.replication.utils.impl.PostgreSQLAtomicObjectQueryManager.getAtomicObject(), org.openmobileis.synchro.algo.replication.utils.impl.OracleAtomicObjectQueryManager.getAtomicObject(), org.openmobileis.synchro.algo.replication.utils.impl.MSSQLAtomicObjectQueryManager.getAtomicObject(), org.openmobileis.synchro.algo.replication.utils.impl.HSQLAtomicObjectQueryManager.getAtomicObject(), org.openmobileis.examples.server.database.JDBCBaseDataFactory.getBaseData(), org.openmobileis.synchro.algo.syncnumber.impl.PostgreSQLSyncNumberQueryManager.getLastSyncNumber(), org.openmobileis.synchro.algo.syncnumber.impl.OracleSafeServerSyncNumberQueryManager.getLastSyncNumber(), org.openmobileis.synchro.algo.syncnumber.impl.MSSQLSyncNumberQueryManager.getLastSyncNumber(), org.openmobileis.synchro.algo.syncnumber.impl.HSQLSyncNumberQueryManager.getLastSyncNumber(), org.openmobileis.synchro.algo.syncnumber.impl.PostgreSQLSyncNumberQueryManager.getTimeStampForsn(), org.openmobileis.synchro.algo.syncnumber.impl.OracleSafeServerSyncNumberQueryManager.getTimeStampForsn(), org.openmobileis.synchro.algo.syncnumber.impl.MSSQLSyncNumberQueryManager.getTimeStampForsn(), org.openmobileis.synchro.algo.syncnumber.impl.HSQLSyncNumberQueryManager.getTimeStampForsn(), org.openmobileis.examples.mycrm.data.jdbc.MyCrmUserManagerDBQuery.getUser(), org.openmobileis.examples.mycrm.data.jdbc.MyCrmUserManagerDBQuery.getUserIDWithloginPass(), and org.openmobileis.examples.mycrm.data.jdbc.MyCrmUserManagerDBQuery.getValidateUserID().
ResultSet org.openmobileis.common.util.database.AbstractQueryManager.executeDynamicQuery | ( | String | queryPattern, | |
java.util.Hashtable | variables | |||
) | throws DatabaseException [protected] |
executeQuery() allows to execute a query such as "SELECT * FROM TABLE") use SQL syntax to perform queries Connection is not close to keep the resulting resultset.
It must be garbaged by calling ManagerDB.getManager().garbageOpenedConnection();;
String | representing the query |
SQLException |
Definition at line 172 of file AbstractQueryManager.java.
void org.openmobileis.common.util.database.AbstractQueryManager.executeUpdate | ( | String | queryPattern, | |
String | parameters[] | |||
) | throws DatabaseException [protected] |
executeUpdateQuery() allows to execute a query with INSERT, UPDATE or DELETE statements use SQL syntax to perform queries
Close and garbage the connection and pending result.
String | representing the query |
SQLException |
Definition at line 200 of file AbstractQueryManager.java.
Referenced by org.openmobileis.synchro.algo.syncnumber.impl.PostgreSQLSyncNumberQueryManager.createSyncTable(), org.openmobileis.synchro.algo.syncnumber.impl.OracleSafeServerSyncNumberQueryManager.createSyncTable(), org.openmobileis.synchro.algo.syncnumber.impl.MSSQLSyncNumberQueryManager.createSyncTable(), org.openmobileis.modules.common.database.jdbc.JDBCGlobalPropertyQueryManager.createSyncTable(), org.openmobileis.examples.server.database.JDBCBaseDataFactory.createSyncTable(), org.openmobileis.synchro.algo.syncnumber.impl.HSQLSyncNumberQueryManager.createSyncTable(), org.openmobileis.synchro.algo.replication.utils.impl.PostgreSQLAtomicObjectQueryManager.createTable(), org.openmobileis.synchro.algo.replication.utils.impl.OracleAtomicObjectQueryManager.createTable(), org.openmobileis.synchro.algo.replication.utils.impl.MSSQLAtomicObjectQueryManager.createTable(), org.openmobileis.synchro.algo.replication.utils.impl.HSQLAtomicObjectQueryManager.createTable(), org.openmobileis.synchro.algo.syncnumber.impl.PostgreSQLSyncNumberQueryManager.delete(), org.openmobileis.synchro.algo.syncnumber.impl.OracleSafeServerSyncNumberQueryManager.delete(), org.openmobileis.synchro.algo.syncnumber.impl.MSSQLSyncNumberQueryManager.delete(), org.openmobileis.modules.common.database.jdbc.JDBCGlobalPropertyQueryManager.delete(), org.openmobileis.examples.server.database.JDBCBaseDataFactory.delete(), and org.openmobileis.synchro.algo.syncnumber.impl.HSQLSyncNumberQueryManager.delete().
void org.openmobileis.common.util.database.AbstractQueryManager.executeDynamicUpdate | ( | String | queryPattern, | |
java.util.Hashtable | variables | |||
) | throws DatabaseException [protected] |
executeUpdateQuery() allows to execute a query with INSERT, UPDATE or DELETE statements use SQL syntax to perform queries Connection is not close to keep the resulting resultset.
It must be garbaged by calling ManagerDB.getManager().garbageOpenedConnection();;
String | representing the query |
SQLException |
Definition at line 232 of file AbstractQueryManager.java.
String org.openmobileis.common.util.database.AbstractQueryManager.buildQuery | ( | String | queryPattern, | |
String | parameters[] | |||
) | throws DatabaseException [protected] |
buildQuery() get the query pattern stored in queries and insert the parameters.
String | QueryPattern representing the query with the variables | |
String | parameters representing the variable values or piece of sql codes x% represents a variable and code% represents a piece of sql code to replace |
Exception |
Definition at line 290 of file AbstractQueryManager.java.
References org.openmobileis.common.util.database.AbstractQueryManager.Separator.
ManagerDB org.openmobileis.common.util.database.AbstractQueryManager.getDbManager | ( | ) |
Returns the dbManager.
Reimplemented in org.openmobileis.examples.mycrm.data.jdbc.MyCrmTerminalUserlQuery.
Definition at line 361 of file AbstractQueryManager.java.
References org.openmobileis.common.util.database.ManagerDB.getManager().
Referenced by org.openmobileis.examples.mycrm.data.jdbc.MyCrmJDBCUserFactory.authenticateUser(), org.openmobileis.modules.common.database.jdbc.JDBCGlobalPropertyFactory.deleteProperty(), org.openmobileis.examples.mycrm.data.jdbc.MyCrmLabelSynchroTarget.getAllCollectionObject(), org.openmobileis.modules.common.database.jdbc.JDBCGlobalPropertyFactory.getAllGlobalProperties(), org.openmobileis.synchro.algo.replication.utils.DefaultSynchroAtomicObjectDelegate.getAllModifiedAtomicObjectForServiceSince(), org.openmobileis.synchro.algo.replication.utils.DefaultSynchroAtomicObjectDelegate.getAtomicObject(), org.openmobileis.examples.mycrm.data.jdbc.MyCrmLabelSynchroTarget.getCollectionObjectWithId(), org.openmobileis.modules.common.database.jdbc.JDBCGlobalPropertyFactory.getPropertiesForService(), org.openmobileis.modules.common.database.jdbc.JDBCGlobalPropertyFactory.getProperty(), org.openmobileis.examples.mycrm.data.jdbc.MyCrmJDBCUserFactory.getUser(), org.openmobileis.modules.common.database.jdbc.JDBCGlobalPropertyFactory.storeProperty(), and org.openmobileis.examples.server.synchro.BaseDataFODBSyncTarget.updateCollectionObject().