OpenPetra
Free Administration Software for Non-Profits
|
This class allows to cache common SQL queries. More...
Public Member Functions | |
TSQLCache () | |
Provides a simple method for caching datasets for queries that are called again and again. More... | |
DataSet | GetDataSet (String sql, OdbcParameter[] AParameters, DataTable ATable, TDataBase ADataBase=null) |
checks if the result for this query is already cached. If not, the result is retrieved from the database. The result is added to the cache, and the result is returned as a DataSet from the cache. More... | |
DataSet | GetDataSet (String sql, OdbcParameter[] AParameters, TDataBase ADataBase=null) |
checks if the result for this query is already cached. If not, the result is retrieved from the database. The result is added to the cache, and the result is returned as a DataSet from the cache. More... | |
DataTable | GetDataTable (string sql, OdbcParameter[] AParameters, DataTable ATable, TDataBase ADataBase=null) |
checks if the result for this query is already cached. If not, the result is retrieved from the database. The result is added to the cache, and the result is returned as a DataTable from the cache. More... | |
DataTable | GetDataTable (String sql, OdbcParameter[] AParameters=null, TDataBase ADataBase=null) |
checks if the result for this query is already cached. If not, the result is retrieved from the database. The result is added to the cache, and the result is returned as a DataTable from the cache. More... | |
DataTable | GetDataTable (String sql, TDataBase ADataBase) |
overloaded method More... | |
ArrayList | GetStringList (String sql, OdbcParameter[] AParameters=null, TDataBase ADataBase=null) |
checks if the result for this query is already cached. If not, the result is retrieved from the database. The result is added to the cache, and the result is returned as a ArrayList from the cache. The ArrayList consists of the strings of the first column of the first table in the dataset. More... | |
ArrayList | GetStringList (String sql, TDataBase ADataBase) |
overloaded method More... | |
void | InvalidateTable (String tablename) |
remove all cached resultsets which have the table in their sql statement. More... | |
void | Invalidate () |
remove all cached resultsets More... | |
This class allows to cache common SQL queries.
FIXME This class does not operate in a thread-safe manner - it needs to be made thread-safe by using locks anywhere where the two internally-held ArrayLists are accessed!!!
The queries are just stored as strings and compared as strings.
|
inline |
Provides a simple method for caching datasets for queries that are called again and again.
The queries are just stored as strings and compared as strings.
|
inline |
checks if the result for this query is already cached. If not, the result is retrieved from the database. The result is added to the cache, and the result is returned as a DataSet from the cache.
sql | |
AParameters | odbc parameters |
ATable | can already have some prepared columns; optional parameter, can be null |
ADataBase | An instantiated TDataBase object, or null (default = null). If null gets passed then the Method executes DB commands with a new DataBase connection |
|
inline |
checks if the result for this query is already cached. If not, the result is retrieved from the database. The result is added to the cache, and the result is returned as a DataSet from the cache.
sql | |
AParameters | odbc parameters |
ADataBase | An instantiated TDataBase object, or null (default = null). If null gets passed then the Method executes DB commands with a new DataBase connection |
|
inline |
checks if the result for this query is already cached. If not, the result is retrieved from the database. The result is added to the cache, and the result is returned as a DataTable from the cache.
sql | |
AParameters | odbc parameters |
ATable | can already have some prepared columns; optional parameter, can be nil |
ADataBase | An instantiated TDataBase object, or null (default = null). If null gets passed then the Method executes DB commands with a new DataBase connection |
|
inline |
checks if the result for this query is already cached. If not, the result is retrieved from the database. The result is added to the cache, and the result is returned as a DataTable from the cache.
sql | |
AParameters | odbc parameters |
ADataBase | An instantiated TDataBase object, or null (default = null). If null gets passed then the Method executes DB commands with a new DataBase connection |
|
inline |
overloaded method
|
inline |
checks if the result for this query is already cached. If not, the result is retrieved from the database. The result is added to the cache, and the result is returned as a ArrayList from the cache. The ArrayList consists of the strings of the first column of the first table in the dataset.
sql | |
AParameters | odbc parameters |
ADataBase | An instantiated TDataBase object, or null (default = null). If null gets passed then the Method executes DB commands with a new DataBase connection |
|
inline |
overloaded method
|
inline |
remove all cached resultsets
|
inline |
remove all cached resultsets which have the table in their sql statement.