NCBI C++ ToolKit
|
Search Toolkit Book for IConnection
#include <dbapi/dbapi.hpp>
Public Types | |
enum | EConnMode { eBulkInsert = I_DriverContext::fBcpIn , ePasswordEncrypted = I_DriverContext::fPasswordEncrypted } |
Which connection mode. More... | |
Public Member Functions | |
virtual | ~IConnection () |
Destructor. More... | |
virtual void | SetMode (EConnMode mode)=0 |
Set connection mode. More... | |
virtual void | ResetMode (EConnMode mode)=0 |
Reset connection mode. More... | |
virtual unsigned int | GetModeMask ()=0 |
Get mode mask. More... | |
virtual void | ForceSingle (bool enable)=0 |
Force single connection mode, default false. More... | |
virtual IDataSource * | GetDataSource ()=0 |
Get parent datasource object. More... | |
virtual void | Connect (const string &user, const string &password, const string &server, const string &database=kEmptyStr)=0 |
Connect to a database. More... | |
virtual void | Connect (const CDBConnParams ¶ms)=0 |
Connect to a database. More... | |
virtual void | ConnectValidated (IConnValidator &validator, const string &user, const string &password, const string &server, const string &database=kEmptyStr)=0 |
Connect to a database using connect validator. More... | |
virtual IConnection * | CloneConnection (EOwnership ownership=eNoOwnership)=0 |
Clone existing connection. More... | |
virtual void | SetDatabase (const string &name)=0 |
Set current database. More... | |
virtual string | GetDatabase ()=0 |
Get current database. More... | |
virtual bool | IsAlive ()=0 |
Check if the connection is alive. More... | |
virtual IStatement * | GetStatement ()=0 |
Get statement object for regular SQL queries. More... | |
virtual ICallableStatement * | GetCallableStatement (const string &proc)=0 |
Get callable statement object for stored procedures. More... | |
ICallableStatement * | GetCallableStatement (const string &proc, int) |
virtual ICursor * | GetCursor (const string &name, const string &sql, int batchSize)=0 |
Get cursor object. More... | |
ICursor * | GetCursor (const string &name, const string &sql) |
ICursor * | GetCursor (const string &name, const string &sql, int, int batchSize) |
virtual IBulkInsert * | GetBulkInsert (const string &table_name)=0 |
Create bulk insert object. More... | |
IBulkInsert * | GetBulkInsert (const string &table_name, unsigned int) |
virtual IStatement * | CreateStatement ()=0 |
Get statement object for regular SQL queries. More... | |
virtual ICallableStatement * | PrepareCall (const string &proc)=0 |
Get callable statement object for stored procedures. More... | |
ICallableStatement * | PrepareCall (const string &proc, int) |
virtual ICursor * | CreateCursor (const string &name, const string &sql, int batchSize)=0 |
Get cursor object. More... | |
ICursor * | CreateCursor (const string &name, const string &sql) |
ICursor * | CreateCursor (const string &name, const string &sql, int, int batchSize) |
virtual IBulkInsert * | CreateBulkInsert (const string &table_name)=0 |
Create bulk insert object. More... | |
IBulkInsert * | CreateBulkInsert (const string &table_name, unsigned int) |
virtual void | Close ()=0 |
Close connecti. More... | |
virtual void | Abort ()=0 |
Abort connection. More... | |
virtual void | SetTimeout (size_t nof_secs)=0 |
Set connection timeout. More... | |
virtual void | SetCancelTimeout (size_t) |
Set timeout for command cancellation and connection closing. More... | |
virtual size_t | GetTimeout (void) const |
Get connection timeout. More... | |
virtual size_t | GetCancelTimeout (void) const |
Get timeout for command cancellation and connection closing. More... | |
virtual void | MsgToEx (bool v)=0 |
If enabled, redirects all error messages to CDB_MultiEx object (see below). More... | |
virtual CDB_MultiEx * | GetErrorAsEx ()=0 |
Returns all error messages as a CDB_MultiEx object. More... | |
virtual string | GetErrorInfo ()=0 |
Returns all error messages as a single string. More... | |
virtual const CVersionInfo & | GetVersionInfo () const =0 |
virtual CDB_Connection * | GetCDB_Connection ()=0 |
Returns the internal driver connection object. More... | |