|
OCILIB (C and C++ Driver for Oracle)
4.0.0
|
A connection or session with a specific database. More...
#include <ocilib.hpp>
Inherits ocilib::HandleHolder< OCI_Connection * >.
Public Types | |
| enum | FailoverRequestValues { FailoverRequestSession = OCI_FOT_SESSION, FailoverRequestSelect = OCI_FOT_SELECT } |
| Failover request enumerated values. More... | |
| enum | FailoverEventValues { FailoverEventEnd = OCI_FOE_END, FailoverEventAbort = OCI_FOE_ABORT, FailoverEventReauthentificate = OCI_FOE_REAUTH, FailoverEventBegin = OCI_FOE_BEGIN, FailoverEventError = OCI_FOE_ERROR } |
| Failover events enumerated values. More... | |
| enum | FailoverResultValues { FailoverOk = OCI_FOC_OK, FailoverRetry = OCI_FOC_RETRY } |
| Failover callback results enumerated values. More... | |
| enum | SessionTraceValues { TraceIdentity = OCI_TRC_IDENTITY, TraceModule = OCI_TRC_MODULE, TraceAction = OCI_TRC_ACTION, TraceDetail = OCI_TRC_DETAIL } |
| Session trace enumerated values. More... | |
| typedef Enum < FailoverRequestValues > | FailoverRequest |
| Failover requests. More... | |
| typedef Enum< FailoverEventValues > | FailoverEvent |
| Failover events. More... | |
| typedef Enum < FailoverResultValues > | FailoverResult |
| Failover callback results. More... | |
| typedef Enum< SessionTraceValues > | SessionTrace |
| Session traces. More... | |
| typedef FailoverResult(* | TAFHandlerProc )(Connection &con, FailoverRequest failoverRequest, FailoverEvent failoverEvent) |
| User callback for TAF event notifications. | |
Public Member Functions | |
| Connection () | |
| Default constructor. | |
| Connection (const ostring &db, const ostring &user, const ostring &pwd, Environment::SessionFlags sessionFlags=Environment::SessionDefault) | |
| Constructor that creates an opens an underlying DB connection with the given information. More... | |
| void | Open (const ostring &db, const ostring &user, const ostring &pwd, Environment::SessionFlags sessionFlags=Environment::SessionDefault) |
| Create a physical connection to an Oracle database server. More... | |
| void | Close () |
| Close the physical connection to the DB server. | |
| void | Commit () |
| Commit current pending changes. | |
| void | Rollback () |
| Cancel current pending changes. | |
| void | Break () |
| Perform an immediate abort of any currently Oracle OCI call on the given connection. More... | |
| void | SetAutoCommit (bool enabled) |
| Enable or disable auto commit mode (implicit commits after every SQL execution) More... | |
| bool | GetAutoCommit () const |
| Indicates if auto commit is currently activated. | |
| bool | IsServerAlive () const |
| Indicate if the connection is still connected to the server. More... | |
| bool | PingServer () const |
| Performs a round trip call to the server to confirm that the connection to the server is still valid. More... | |
| ostring | GetConnectionString () const |
| Return the name of the connected database/service name. More... | |
| ostring | GetUserName () const |
| Return the current logged user name. More... | |
| ostring | GetPassword () const |
| Return the current logged user password. More... | |
| ostring | GetServerVersion () const |
| Return the connected database server string version. More... | |
| unsigned int | GetVersion () const |
| Return the Oracle version supported by the connection. More... | |
| unsigned int | GetServerMajorVersion () const |
| Return the major version number of the connected database server. | |
| unsigned int | GetServerMinorVersion () const |
| Return the minor version number of the connected database server. | |
| unsigned int | GetServerRevisionVersion () const |
| Return the revision version number of the connected database server. | |
| void | ChangePassword (const ostring &newPwd) |
| Change the password of the logged user. More... | |
| ostring | GetSessionTag () const |
| Return the tag associated with the given connection. | |
| void | SetSessionTag (const ostring &tag) |
| Associate a tag to the given connection/session. More... | |
| Transaction | GetTransaction () const |
| Return the current transaction of the connection. | |
| void | SetTransaction (const Transaction &transaction) |
| Set a transaction to a connection. More... | |
| void | SetDefaultDateFormat (const ostring &format) |
| Set the date format for implicit string / date conversions. More... | |
| ostring | GetDefaultDateFormat () const |
| Return the current date format for implicit string / date conversions. More... | |
| void | SetDefaultNumericFormat (const ostring &format) |
| Set the numeric format for implicit string / numeric conversions. More... | |
| ostring | GetDefaultNumericFormat () const |
| Return the current numeric format for implicit string / numeric conversions. More... | |
| void | EnableServerOutput (unsigned int bufsize, unsigned int arrsize, unsigned int lnsize) |
| Enable the server output. More... | |
| void | DisableServerOutput () |
| Disable the server output. More... | |
| bool | GetServerOutput (ostring &line) const |
| Retrieve one line of the server buffer. More... | |
| void | GetServerOutput (std::vector< ostring > &lines) const |
| Retrieve all remaining lines of the server buffer. | |
| void | SetTrace (SessionTrace trace, const ostring &value) |
| Set tracing information for the session. More... | |
| ostring | GetTrace (SessionTrace trace) const |
| Get the current trace for the trace type from the given connection. More... | |
| ostring | GetDatabase () const |
| Return the Oracle server database name of the connected database/service name. More... | |
| ostring | GetInstance () const |
| Return the Oracle server Instance name of the connected database/service name. More... | |
| ostring | GetService () const |
| Return the Oracle server Service name of the connected database/service name. More... | |
| ostring | GetServer () const |
| Return the Oracle server Hos name of the connected database/service name. More... | |
| ostring | GetDomain () const |
| Return the Oracle server Domain name of the connected database/service name. More... | |
| Timestamp | GetInstanceStartTime () const |
| Return the date and time (Timestamp) server instance start of the. More... | |
| unsigned int | GetStatementCacheSize () const |
| Return the maximum number of statements to keep in the statement cache. More... | |
| void | SetStatementCacheSize (unsigned int value) |
| Set the maximum number of statements to keep in the statement cache. More... | |
| unsigned int | GetDefaultLobPrefetchSize () const |
| Return the default LOB prefetch buffer size for the connection. More... | |
| void | SetDefaultLobPrefetchSize (unsigned int value) |
| Enable or disable prefetching for all LOBs fetched in the connection. More... | |
| bool | IsTAFCapable () const |
| Verify if the connection support TAF events. More... | |
| void | SetTAFHandler (TAFHandlerProc handler) |
| Set the Transparent Application Failover (TAF) user handler. More... | |
| AnyPointer | GetUserData () |
| Return the pointer to user data previously associated with the connection. | |
| void | SetUserData (AnyPointer value) |
| Associate a pointer to user data to the given connection. More... | |
A connection or session with a specific database.
This class wraps the OCILIB object handle OCI_Connection and its related methods
Definition at line 1465 of file ocilib.hpp.
Failover requests.
Possible values are Connection::FailoverRequestValues
Definition at line 1505 of file ocilib.hpp.
Failover events.
Possible values are Connection::FailoverEventValues
Definition at line 1533 of file ocilib.hpp.
Failover callback results.
Possible values are Connection::FailoverResultValues
Definition at line 1555 of file ocilib.hpp.
Session traces.
Possible values are Connection::SessionTraceValues
Definition at line 1581 of file ocilib.hpp.
Failover request enumerated values.
| Enumerator | |
|---|---|
| FailoverRequestSession |
User has requested only session failover |
| FailoverRequestSelect |
User has requested select failover as well |
Definition at line 1490 of file ocilib.hpp.
Failover events enumerated values.
Definition at line 1512 of file ocilib.hpp.
Failover callback results enumerated values.
| Enumerator | |
|---|---|
| FailoverOk |
Default acknowledgment of a failover event |
| FailoverRetry |
Triggers a new failover attempt |
Definition at line 1540 of file ocilib.hpp.
Session trace enumerated values.
Definition at line 1562 of file ocilib.hpp.
|
inline |
Constructor that creates an opens an underlying DB connection with the given information.
| db | - Oracle Service Name |
| user | - Oracle User name |
| pwd | - Oracle User password |
| sessionFlags | - Session Flags |
Definition at line 1041 of file ocilib_impl.hpp.
References Open().
|
inline |
Create a physical connection to an Oracle database server.
| db | - Oracle Service Name |
| user | - Oracle User name |
| pwd | - Oracle User password |
| sessionFlags | - Session Flags |
The XA connection string used in a transaction monitor to connect to Oracle must be compatible with OCILIB :
Definition at line 1051 of file ocilib_impl.hpp.
References ocilib::Check(), OCI_ConnectionCreate(), and OCI_ConnectionFree().
Referenced by Connection().
|
inline |
Perform an immediate abort of any currently Oracle OCI call on the given connection.
Definition at line 1072 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_Break().
|
inline |
Enable or disable auto commit mode (implicit commits after every SQL execution)
| enabled | - auto commit new status |
Definition at line 1077 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_SetAutoCommit().
|
inline |
Indicate if the connection is still connected to the server.
Definition at line 1087 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IsConnected().
|
inline |
Performs a round trip call to the server to confirm that the connection to the server is still valid.
Definition at line 1092 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_Ping().
|
inline |
Return the name of the connected database/service name.
Definition at line 1097 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::MakeString(), and OCI_GetDatabase().
|
inline |
Return the current logged user name.
Definition at line 1102 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::MakeString(), and OCI_GetUserName().
|
inline |
Return the current logged user password.
Definition at line 1107 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::MakeString(), and OCI_GetPassword().
|
inline |
Return the connected database server string version.
Definition at line 1117 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::MakeString(), and OCI_GetVersionServer().
|
inline |
Return the Oracle version supported by the connection.
Definition at line 1112 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_GetVersionConnection().
|
inline |
Change the password of the logged user.
| newPwd | - New password |
Definition at line 1137 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_SetPassword().
|
inline |
Associate a tag to the given connection/session.
| tag | - user tag string |
Definition at line 1147 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_SetSessionTag().
|
inline |
Set a transaction to a connection.
| transaction | - Transaction to assign |
Definition at line 1157 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_SetTransaction().
|
inline |
Set the date format for implicit string / date conversions.
| format | - Date format |
Definition at line 1162 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_SetDefaultFormatDate().
|
inline |
Return the current date format for implicit string / date conversions.
Definition at line 1172 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::MakeString(), and OCI_GetDefaultFormatDate().
|
inline |
Set the numeric format for implicit string / numeric conversions.
| format | - Numeric format |
Definition at line 1167 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_SetDefaultFormatNumeric().
|
inline |
Return the current numeric format for implicit string / numeric conversions.
Definition at line 1177 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::MakeString(), and OCI_GetDefaultFormatNumeric().
|
inline |
Enable the server output.
| bufsize | - server buffer max size (server side) |
| arrsize | - number of lines to retrieve per server round-trip |
| lnsize | - maximum size of one line |
Definition at line 1182 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_ServerEnableOutput().
|
inline |
Disable the server output.
Definition at line 1187 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_ServerDisableOutput().
|
inline |
Retrieve one line of the server buffer.
Definition at line 1192 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::MakeString(), and OCI_ServerGetOutput().
|
inline |
Set tracing information for the session.
| trace | - trace type |
| value | - trace content |
Store current trace information to the given connection handle. These information:
system view V$SESSION
Definition at line 1212 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_SetTrace().
|
inline |
Get the current trace for the trace type from the given connection.
| trace | - trace type |
Definition at line 1217 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::MakeString(), and OCI_GetTrace().
|
inline |
Return the Oracle server database name of the connected database/service name.
Definition at line 1222 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::MakeString(), and OCI_GetDBName().
|
inline |
Return the Oracle server Instance name of the connected database/service name.
Definition at line 1227 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_GetInstanceName().
|
inline |
Return the Oracle server Service name of the connected database/service name.
Definition at line 1232 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::MakeString(), and OCI_GetServiceName().
|
inline |
Return the Oracle server Hos name of the connected database/service name.
Definition at line 1237 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_GetServerName().
|
inline |
Return the Oracle server Domain name of the connected database/service name.
Definition at line 1242 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::MakeString(), and OCI_GetDomainName().
|
inline |
Return the date and time (Timestamp) server instance start of the.
Definition at line 1247 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_GetInstanceStartTime().
|
inline |
Return the maximum number of statements to keep in the statement cache.
Definition at line 1252 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_GetStatementCacheSize().
|
inline |
Set the maximum number of statements to keep in the statement cache.
| value | - maximum number of statements in the cache |
Definition at line 1257 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_SetStatementCacheSize().
|
inline |
Return the default LOB prefetch buffer size for the connection.
Definition at line 1262 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_GetDefaultLobPrefetchSize().
|
inline |
Enable or disable prefetching for all LOBs fetched in the connection.
| value | - default prefetch buffer size |
Definition at line 1267 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_SetDefaultLobPrefetchSize().
|
inline |
Verify if the connection support TAF events.
Definition at line 1272 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IsTAFCapable().
|
inline |
Set the Transparent Application Failover (TAF) user handler.
| handler | - TAF handler procedure |
Definition at line 1277 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_SetTAFHandler().
|
inline |
Associate a pointer to user data to the given connection.
| value | - User data pointer |
Definition at line 1291 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_SetUserData().