SQLArchive Class ReferenceSQL-database archive of objects.
More...
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Public Member Functions | |
| int | getAvailableConnections () const |
| Get number of connections that are available for streams and getConnection() function. | |
| DbConnection * | getConnection () |
| Get connection from archive. | |
| virtual const ConvSpec & | getConversionSpecs () const |
| Get current conversion specification from internal database object. | |
| Database * | getDatabase () |
| Get pointer to database that archive is using. | |
| SQLIdFetcher * | getIdFetcher () const |
| Get associated id fetcher or NULL if none was set. | |
| virtual IStream * | getInputStream () |
| Create input stream. | |
| SQLIStream | getIStream () |
| Create SQLIStream using one connection from pool. | |
| SQLOStream | getOStream () |
| Create output stream using one connection from pool. | |
| virtual OStream * | getOutputStream () |
| Create output stream. | |
| std::list< std::string > | getTableNames () |
| Get list of available tables. | |
| int | getUsedConnections () const |
| Get number of currently used connections. | |
| void | initPlugin (const char *pPluginName) |
| Initialize internal plugin and create database instance owned by SQLArchive. | |
| bool | isDatabaseOwner () const |
| Check if this instance owns mDb. | |
| virtual bool | isOpen () const |
| Check if archive is open. | |
| void | open (const char *pPluginName, const char *pConnectString) |
| Load database plugin, check its version, initialize it and connect to database using pConnectString argument. | |
| virtual void | open (const char *pConnectString) |
| Connect to already initialized database. | |
| virtual void | setConversionSpecs (const ConvSpec &pSpecs) |
| Set new conversion specification for archive. | |
| void | setDatabase (Database *pDb) |
| Set database plugin for archive. | |
| void | setIdFetcher (SQLIdFetcher *pFetcher) |
| Set fetcher on archive. | |
| SQLArchive (Database *pDb=NULL) | |
| Constructor. | |
| virtual | ~SQLArchive () |
| Destructor. | |
Static Public Member Functions | |
| static bool | handleError (void *pOwner, int pType, const char *pMsg) |
| default error handler for archive. | |
Protected Member Functions | |
| void | closeAllConnections () |
| close all connections to database | |
| void | destroyPlugin () |
| close all connnections and delete mPlugin and mDb (if owned, see mPlugin description) | |
| DbConnection * | getFreeConnection (bool pRelease=false) |
| Get or allocate new connection. | |
Protected Attributes | |
| std::list< DbConnection * > | mConnections |
| List of open connections. | |
| std::string | mConnectStr |
| Connect string used to create new connection. | |
| Database * | mDb |
| Pointer to internal database object. | |
| SQLIdFetcher * | mFetcher |
| SQLFetcher. | |
| DbPlugin * | mPlugin |
| Plugin loaded for database object creation - NULL if database is set using constructor or setDatabase function. | |
This should store binded var in the youngest child table
|
|
Constructor. Archive does not take ownership on passed Database pointer, you have to delete it using DbPlugin instance that was used to load it.
|
|
|
Get connection from archive. If all connections are used then new connection will be created using ConnectString passed to open().
|
|
|
Get or allocate new connection.
|
|
|
Create input stream. Returned value must be deleted
Implements Archive. |
|
|
Create SQLIStream using one connection from pool. If you want to load and store objects using single connection then consider using Transaction and create streams from there.
|
|
|
Create output stream using one connection from pool.
|
|
|
Create output stream. Returned value must be deleted
Implements Archive. |
|
|
Get list of available tables. Must be called after open()
|
|
||||||||||||||||
|
default error handler for archive. It throws SQLException or DatabaseException depends on error type.
|
|
|
Initialize internal plugin and create database instance owned by SQLArchive. Used by open(const char* pPluginName, const char* pConnectString)
|
|
|
Check if archive is open.
Implements Archive. |
|
||||||||||||
|
Load database plugin, check its version, initialize it and connect to database using pConnectString argument.
|
|
|
Connect to already initialized database. You have to set database first to use this function, or (better) use open(pPluginName, pConnectString), which will load plugin and create database automatically.
Implements Archive. |
|
|
Set new conversion specification for archive. Call to this method will update conversion specification on internal database object and all connections to database that are managed by this archive
|
|
|
Set database plugin for archive. Must be called on closed archive. Archive does not take ownership on this pointer, you have to delete it using DbPlugin instance that was used to load it.
|
|
|
Set fetcher on archive.
|
|
|
SQLFetcher. Must not be NULL when streams are created. |
|
|
Plugin loaded for database object creation - NULL if database is set using constructor or setDatabase function. NULL value also means that we are not owner of mDb pointer |
| Documentation |
|---|
| Quick start |
| Examples |
| Search |
| API Documentation |
|---|
| Class hierarchy |
| Member index |
| API Reference |
| Store filters |
| Store table macros |