Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

org.openmobileis.common.util.database.AbstractQueryManager Class Reference

Inheritance diagram for org.openmobileis.common.util.database.AbstractQueryManager:

org.openmobileis.modules.crm.database.common.jdbc.JDBCGlobalPropertyQueryManager org.openmobileis.synchro.algo.syncnumber.impl.MSSQLSyncNumberQueryManager org.openmobileis.synchro.algo.syncnumber.impl.OracleSafeServerSyncNumberQueryManager org.openmobileis.synchro.algo.syncnumber.impl.PostgreSQLSyncNumberQueryManager List of all members.

Detailed Description

Title: OpenMobileIS project source
Description: This class is ths super class of the queries It allows to execute queries through the db manager.

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.

Author:
Philippe Delrieu
Since:
JDK 1.1
Version:
1.0.

Definition at line 57 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

ResultSet executeQuery (String queryPattern, String parameters[])
 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)
 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 ServiceException
 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 ServiceException
 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[])
 buildQuery() get the query pattern stored in queries and insert the parameters.
String makeSQLList (String[] items)

Static Package Attributes

static char Separator = '%'


Member Function Documentation

String org.openmobileis.common.util.database.AbstractQueryManager.buildQuery String  queryPattern,
String  parameters[]
[protected]
 

buildQuery() get the query pattern stored in queries and insert the parameters.

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
Returns:
String : definitive query
Exceptions:
Exception 

Definition at line 265 of file AbstractQueryManager.java.

References org.openmobileis.common.util.database.AbstractQueryManager.Separator.

void org.openmobileis.common.util.database.AbstractQueryManager.close  ) 
 

close() allows to close the database

Parameters:
None 
Returns:
None
Exceptions:
None 

Definition at line 92 of file AbstractQueryManager.java.

ResultSet org.openmobileis.common.util.database.AbstractQueryManager.executeDynamicQuery String  queryPattern,
java.util.Hashtable  variables
[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();;

Parameters:
String representing the query
Returns:
ResultSet : don't forget to close the resultSet after using.
Exceptions:
SQLException 

Definition at line 140 of file AbstractQueryManager.java.

void org.openmobileis.common.util.database.AbstractQueryManager.executeDynamicUpdate String  queryPattern,
java.util.Hashtable  variables
throws ServiceException [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();;

Parameters:
String representing the query
Returns:
None
Exceptions:
SQLException 

Definition at line 200 of file AbstractQueryManager.java.

ResultSet org.openmobileis.common.util.database.AbstractQueryManager.executeQuery String  queryPattern,
String  parameters[]
[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();;

Parameters:
String representing the query
Returns:
ResultSet : don't forget to close the resultSet after using.
Exceptions:
SQLException 

Definition at line 105 of file AbstractQueryManager.java.

Referenced by 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.PostgreSQLSyncNumberQueryManager.getTimeStampForsn(), org.openmobileis.synchro.algo.syncnumber.impl.OracleSafeServerSyncNumberQueryManager.getTimeStampForsn(), and org.openmobileis.synchro.algo.syncnumber.impl.MSSQLSyncNumberQueryManager.getTimeStampForsn().

void org.openmobileis.common.util.database.AbstractQueryManager.executeUpdate String  queryPattern,
String  parameters[]
throws ServiceException [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.

Parameters:
String representing the query
Returns:
None
Exceptions:
SQLException 

Definition at line 167 of file AbstractQueryManager.java.

ManagerDB org.openmobileis.common.util.database.AbstractQueryManager.getDbManager  ) 
 

Returns the dbManager.

Returns:
ManagerDB

Definition at line 339 of file AbstractQueryManager.java.

References org.openmobileis.common.util.database.ManagerDB.getManager().

Referenced by org.openmobileis.modules.crm.database.common.jdbc.JDBCGlobalPropertyFactory.deleteProperty(), org.openmobileis.modules.crm.database.common.jdbc.JDBCGlobalPropertyFactory.getAllGlobalProperties(), org.openmobileis.modules.crm.database.common.jdbc.JDBCGlobalPropertyFactory.getPropertiesForService(), org.openmobileis.modules.crm.database.common.jdbc.JDBCGlobalPropertyFactory.getProperty(), and org.openmobileis.modules.crm.database.common.jdbc.JDBCGlobalPropertyFactory.storeProperty().


The documentation for this class was generated from the following file:
Generated on Wed Dec 14 21:05:37 2005 for OpenMobileIS by  doxygen 1.4.4