VisualIB
1.0
IBExpress library for making use of Borland IBExpress outside of C++Builder
|
VIB::Database wraps the VisualIB VIBDatabase C structure to provide a C++11 object with semantics compatible with those of Borland TIBDatabase. More...
#include <classVIBDatabase.h>
Classes | |
class | DBParamClass |
Class implementing the DBParamByDPB property, which reimplements the AnsiString DBParamByDPB[int Idx] property of TIBDatabase. More... | |
class | ParamClass |
Class implementing the Params property, which reimplements the TStrings *Params property of TIBDatabase. More... | |
Public Member Functions | |
Database (VIBDatabase *pvdb=NULL) | |
Construct a VIB::Database instance. | |
virtual | ~Database () |
Destroy the VIB::Database. | |
VIBDatabase * | getVIBDatabase () const |
Get a pointer to the wrapped VIBDatabase structure instance, for use with the VisualIB C API. | |
int | Call (int ErrCode, bool RaiseError) |
Internal method used to make calls to the InterBase API. | |
void | CheckActive () |
Call CheckActive to raise an error if the connection to the database server is inactive. | |
void | CheckDatabaseName () |
Call CheckDatabaseName to check if the DatabaseName property is empty, and raise an error if it is. | |
void | CheckInactive () |
Call CheckInactive to raise an error if the connection to the database server is active. | |
void | Close () |
Call Close to disconnect from the source of database information. | |
void | CloseDataSets () |
Call CloseDataSets to close all active datasets without disconnecting from the database server. | |
void | CreateDatabase () |
Call CreateDatabase to create a database using Params as the rest of the CREATE DATABASE command. | |
void | DropDatabase () |
Call DropDatabase to drop a database, which removes the database file from the server. | |
void | ForceClose () |
Use ForceClose to force the database connection to close; even if the underlying API call fails, the database handle is reset to NULL. | |
void | FlushSchema () |
Undocumented TIBDatabase method. | |
bool | Has_COMPUTED_BLR (const std::string &Relation, const std::string &Field) |
Undocumented TIBDatabase method. | |
bool | Has_DEFAULT_VALUE (const std::string &Relation, const std::string &Field) |
Undocumented TIBDatabase method. | |
int | IndexOfDBConst (const char *st) |
Use IndexOfDBConst to locate a parameter in the database parameters list. | |
void | Open () |
Call Open to establish a connection to the source of database information. | |
bool | TestConnected () |
Use TestConnected to determine whether a database is connected to the server. | |
void | RemoveTransaction (int Idx) |
Call RemoveTransaction to disassociate a specified transaction from the database. | |
void | RemoveTransactions () |
Call RemoveTransactions to disassociate all transactions from the database. | |
Public Attributes | |
Property< bool > | AllowStreamedConnected |
Undocumented property. | |
Property< bool > | Connected |
Set to true to establish a database connection without opening a dataset. | |
Property< std::string > | DatabaseName |
Use to specify the name of the database to use with a database component. | |
Property< int > | DataSetCount |
Use to determine the number of datasets listed by the DataSets property. | |
Property< int > | DBSQLDialect |
Get the database SQL dialect. | |
Property< void ** > | Handle |
Use to make calls directly to the InterBase API. | |
Property< bool > | HandleIsShared |
Read to determine if the handle to the database is shared. | |
Property< int > | IdleTimer |
Specifies how long the database should wait before disconnecting an idle connection. | |
Property< bool > | IsReadOnly |
Indicates whether or not the database is set to read-only. | |
Property< bool > | LoginPrompt |
Specifies whether a login dialog appears immediately before opening a new connection. | |
Property< ParamClass * > | Params |
Specifies the database parameters to pass to the InterBase server. | |
Property< int > | SQLDialect |
Sets or returns the SQL dialect used by the client. | |
Property< int > | SQLObjectCount |
Returns the number of SQL objects in the database. | |
Property< VIBTraceFlags > | TraceFlags |
Specifies the database operations to track with the SQL Monitor at runtime. | |
Property< int > | TransactionCount |
Returns the number of transactions associated with the database component. | |
ArrayProperty< DBParamClass *, std::string > | DBParamByDPB |
Use to inspect and set DPB parameters without looking at the Params string list. | |
Protected Attributes | |
VIBDatabase * | vdb |
Wrapped instance of VIBDatabase structure. | |
ParamClass | paramsObj |
Protected instance of Params wrapper object. | |
DBParamClass | dbParamObj |
Protected instance of DBParamByDPB wrapper object. | |
Friends | |
class | ParamClass |
VIB::Database wraps the VisualIB VIBDatabase C structure to provide a C++11 object with semantics compatible with those of Borland TIBDatabase.
VIB::Database::Database | ( | VIBDatabase * | pvdb = NULL | ) |
Construct a VIB::Database instance.
[in] | pvdb | Optional pointer to an existing VIBDatabase structure of which this class instance should take ownership. |
|
virtual |
Destroy the VIB::Database.
Any connections still open on the wrapped VIBDatabase instance will be closed, and then it will be destroyed as well.
int VIB::Database::Call | ( | int | ErrCode, |
bool | RaiseError | ||
) |
Internal method used to make calls to the InterBase API.
Gives the option of raising an exception or returning an error based on the value of RaiseError.
[in] | ErrCode | InterBase API error code. |
[in] | RaiseError | If true, an exception should be raised. |
void VIB::Database::CheckActive | ( | ) |
Call CheckActive to raise an error if the connection to the database server is inactive.
void VIB::Database::CheckDatabaseName | ( | ) |
Call CheckDatabaseName to check if the DatabaseName property is empty, and raise an error if it is.
void VIB::Database::CheckInactive | ( | ) |
Call CheckInactive to raise an error if the connection to the database server is active.
void VIB::Database::Close | ( | ) |
Call Close to disconnect from the source of database information.
Before the connection component is deactivated, all associated datasets are closed. Calling Close is the same as setting the Connected property to false. In most cases, closing a connection frees system resources allocated to the connection.
void VIB::Database::CloseDataSets | ( | ) |
Call CloseDataSets to close all active datasets without disconnecting from the database server.
void VIB::Database::CreateDatabase | ( | ) |
Call CreateDatabase to create a database using Params as the rest of the CREATE DATABASE
command.
void VIB::Database::DropDatabase | ( | ) |
Call DropDatabase to drop a database, which removes the database file from the server.
void VIB::Database::FlushSchema | ( | ) |
Undocumented TIBDatabase method.
void VIB::Database::ForceClose | ( | ) |
Use ForceClose to force the database connection to close; even if the underlying API call fails, the database handle is reset to NULL.
|
inline |
Get a pointer to the wrapped VIBDatabase structure instance, for use with the VisualIB C API.
bool VIB::Database::Has_COMPUTED_BLR | ( | const std::string & | Relation, |
const std::string & | Field | ||
) |
Undocumented TIBDatabase method.
[in] | Relation | Name of a database relation (table, view, etc). |
[in] | Field | Name of a database field. |
bool VIB::Database::Has_DEFAULT_VALUE | ( | const std::string & | Relation, |
const std::string & | Field | ||
) |
Undocumented TIBDatabase method.
[in] | Relation | Name of a database relation (table, view, etc). |
[in] | Field | Name of a database field. |
int VIB::Database::IndexOfDBConst | ( | const char * | st | ) |
Use IndexOfDBConst to locate a parameter in the database parameters list.
void VIB::Database::Open | ( | ) |
Call Open to establish a connection to the source of database information.
Open sets the Connected property to true.
void VIB::Database::RemoveTransaction | ( | int | Idx | ) |
Call RemoveTransaction to disassociate a specified transaction from the database.
[in] | Idx | Index of the transaction to remove. |
void VIB::Database::RemoveTransactions | ( | ) |
Call RemoveTransactions to disassociate all transactions from the database.
bool VIB::Database::TestConnected | ( | ) |
Use TestConnected to determine whether a database is connected to the server.
Property<bool> VIB::Database::Connected |
Set to true to establish a database connection without opening a dataset.
Set to false to close a database connection. An application can check Connected to determine the current status of a database connection.
Property<std::string> VIB::Database::DatabaseName |
Use to specify the name of the database to use with a database component.
For local InterBase databases, this can be a filename. Otherwise, use the standard InterBase server_name:filename syntax.
Property<int> VIB::Database::DataSetCount |
Use to determine the number of datasets listed by the DataSets property.
DataSets may include only the active datasets that use the connection component, or it may list all datasets. Use as an upper bound when iterating through the DataSets property.
ArrayProperty<DBParamClass *, std::string> VIB::Database::DBParamByDPB |
Use to inspect and set DPB parameters without looking at the Params string list.
Property<int> VIB::Database::DBSQLDialect |
Get the database SQL dialect.
Property<void **> VIB::Database::Handle |
Use to make calls directly to the InterBase API.
Property<bool> VIB::Database::HandleIsShared |
Read to determine if the handle to the database is shared.
Property<int> VIB::Database::IdleTimer |
Specifies how long the database should wait before disconnecting an idle connection.
Property<bool> VIB::Database::IsReadOnly |
Indicates whether or not the database is set to read-only.
Property<bool> VIB::Database::LoginPrompt |
Specifies whether a login dialog appears immediately before opening a new connection.
When set to false, the application must supply username and password values programmatically.
Property<ParamClass *> VIB::Database::Params |
Specifies the database parameters to pass to the InterBase server.
Use the Add method of the property object to add string parameters.
Property<int> VIB::Database::SQLDialect |
Sets or returns the SQL dialect used by the client.
If the connection is active, the SQLDialect property canot be set to a value greater than the database SQL dialect. If the connection is inactive, then on connect an OnDialectDowngradeWarning event may be fired and the SQLDialect property will be downgraded to match the database SQL dialect.
Property<int> VIB::Database::SQLObjectCount |
Property<VIBTraceFlags> VIB::Database::TraceFlags |
Specifies the database operations to track with the SQL Monitor at runtime.
TraceFlags is only meaningful for the SQL Monitor, which is provided to enable performance tuning and SQL debugging when working with remote SQL database servers.
Property<int> VIB::Database::TransactionCount |
Returns the number of transactions associated with the database component.