23 #include "ocilibcpp/types.hpp" 40 Open(db, user, pwd, sessionFlags);
45 Acquire(con, reinterpret_cast<HandleFreeFunc>(parent ?
OCI_ConnectionFree :
nullptr),
nullptr, parent);
51 reinterpret_cast<HandleFreeFunc
>(
OCI_ConnectionFree),
nullptr, Environment::GetEnvironmentHandle());
185 return (str !=
nullptr);
194 lines.push_back(str);
273 Environment::SetUserCallback<Connection::TAFHandlerProc>(
static_cast<OCI_Connection*
>(*this), handler);
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetTrace(OCI_Connection *con, unsigned int trace)
Get the current trace for the trace type from the given connection.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetAutoCommit(OCI_Connection *con, boolean enable)
Enable / disable auto commit mode.
Internal usage. Interface for handling ownership and relationship of a C API handle.
void SetTAFHandler(TAFHandlerProc handler)
Set the Transparent Application Failover (TAF) user handler.
ostring GetPassword() const
Return the current logged user password.
struct OCI_Connection OCI_Connection
Oracle physical connection.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetStatementCacheSize(OCI_Connection *con)
Return the maximum number of statements to keep in the statement cache.
unsigned int GetServerRevisionVersion() const
Return the revision version number of the connected database server.
ostring GetServer() const
Return the Oracle server Hos name of the connected database/service name.
void SetTrace(SessionTrace trace, const ostring &value)
Set tracing information for the session.
ostring GetUserName() const
Return the current logged user name.
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetUserName(OCI_Connection *con)
Return the current logged user name.
void SetDefaultLobPrefetchSize(unsigned int value)
Enable or disable pre-fetching for all LOBs fetched in the connection.
void ChangePassword(const ostring &newPwd)
Change the password of the logged user.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetMaxCursors(OCI_Connection *con)
Return the maximum number of SQL statements that can be opened in one session.
void SetAutoCommit(bool enabled)
Enable or disable auto commit mode (implicit commits after every SQL execution)
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetDefaultLobPrefetchSize(OCI_Connection *con)
Return the default LOB prefetch buffer size for the connection.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetTimeout(OCI_Connection *con, unsigned int type)
Returns the requested timeout value for OCI calls that require server round-trips to the given databa...
OCI_SYM_PUBLIC boolean OCI_API OCI_SetStatementCacheSize(OCI_Connection *con, unsigned int value)
Set the maximum number of statements to keep in the statement cache.
OCI_SYM_PUBLIC boolean OCI_API OCI_ConnectionFree(OCI_Connection *con)
Close a physical connection to an Oracle database server.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetTimeout(OCI_Connection *con, unsigned int type, unsigned int value)
Set a given timeout for OCI calls that require server round-trips to the given database.
void Close()
Close the physical connection to the DB server.
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so, it raises a C++ exception using the retrieved error handle.
Oracle Transaction object.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetTrace(OCI_Connection *con, unsigned int trace, const otext *value)
Set tracing information to the session of the given connection.
OCI_SYM_PUBLIC boolean OCI_API OCI_GetAutoCommit(OCI_Connection *con)
Get current auto commit mode status.
Transaction GetTransaction() const
Return the current transaction of the connection.
OCI_SYM_PUBLIC boolean OCI_API OCI_IsTAFCapable(OCI_Connection *con)
Verify if the given connection support TAF events.
Template Flags template class providing some type safety to some extends for manipulating flags set v...
ostring GetDatabase() const
Return the Oracle server database name of the connected database/service name.
void SetTimeout(TimeoutType timeout, unsigned int value)
Set a given timeout for OCI calls that require server round-trips to the given database.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetServerRevisionVersion(OCI_Connection *con)
Return the revision version number of the connected database server.
OCI_SYM_PUBLIC boolean OCI_API OCI_ServerDisableOutput(OCI_Connection *con)
Disable the server output.
OCI_SYM_PUBLIC OCI_Transaction *OCI_API OCI_GetTransaction(OCI_Connection *con)
Return the current transaction of the connection.
ostring GetTrace(SessionTrace trace) const
Get the current trace for the trace type from the given connection.
ostring GetFormat(FormatType formatType)
Return the format string for implicit string conversions of the given type.
OCI_SYM_PUBLIC boolean OCI_API OCI_Break(OCI_Connection *con)
Perform an immediate abort of any currently Oracle OCI call.
unsigned int GetServerMinorVersion() const
Return the minor version number of the connected database server.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetDefaultLobPrefetchSize(OCI_Connection *con, unsigned int value)
Enable or disable prefetching for all LOBs fetched in the connection.
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetDomainName(OCI_Connection *con)
Return the Oracle server domain name of the connected database/service name.
OCI_SYM_PUBLIC void *OCI_API OCI_GetUserData(OCI_Connection *con)
Return the pointer to user data previously associated with the connection.
OCI_SYM_PUBLIC boolean OCI_API OCI_IsConnected(OCI_Connection *con)
Returns TRUE is the given connection is still connected otherwise FALSE.
void SetUserData(AnyPointer value)
Associate a pointer to user data to the given connection.
ostring MakeString(const otext *result, int size=-1)
Internal usage. Constructs a C++ string object from the given OCILIB string pointer.
OCI_SYM_PUBLIC OCI_Connection *OCI_API OCI_ConnectionCreate(const otext *db, const otext *user, const otext *pwd, unsigned int mode)
Create a physical connection to an Oracle database server.
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetInstanceName(OCI_Connection *con)
Return the Oracle server Instance name of the connected database/service name.
void SetTransaction(const Transaction &transaction)
Set a transaction to a connection.
void * AnyPointer
Alias for the generic void pointer.
bool IsServerAlive() const
Indicate if the connection is still connected to the server.
Template Enumeration template class providing some type safety to some extends for manipulating enume...
OracleVersion GetVersion() const
Return the Oracle version supported by the connection.
core::Enum< OracleVersionValues > OracleVersion
Oracle Version.
OCI_SYM_PUBLIC boolean OCI_API OCI_Ping(OCI_Connection *con)
Makes a round trip call to the server to confirm that the connection and the server are active...
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetServiceName(OCI_Connection *con)
Return the Oracle server service name of the connected database/service name.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetServerMajorVersion(OCI_Connection *con)
Return the major version number of the connected database server.
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetDBName(OCI_Connection *con)
Return the Oracle server database name of the connected database/service name.
OCI_SYM_PUBLIC boolean OCI_API OCI_Rollback(OCI_Connection *con)
Cancel current pending changes.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetSessionTag(OCI_Connection *con, const otext *tag)
Associate a tag to the given connection/session.
void SetStatementCacheSize(unsigned int value)
Set the maximum number of statements to keep in the statement cache.
unsigned int GetMaxCursors() const
Return the maximum number of SQL statements that can be opened in one session.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetTransaction(OCI_Connection *con, OCI_Transaction *trans)
Set a transaction to a connection.
unsigned int GetStatementCacheSize() const
Return the maximum number of statements to keep in the statement cache.
void DisableServerOutput()
Disable the server output.
unsigned int GetTimeout(TimeoutType timeout)
Returns the requested timeout value for OCI calls that require server round-trips to the given databa...
OCI_SYM_PUBLIC boolean OCI_API OCI_SetFormat(OCI_Connection *con, unsigned int type, const otext *format)
Set the format string for implicit string conversions of the given type.
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetSessionTag(OCI_Connection *con)
Return the tag associated the given connection.
bool IsTAFCapable() const
Verify if the connection support TAF events.
OCI_SYM_PUBLIC const otext *OCI_API OCI_ServerGetOutput(OCI_Connection *con)
Retrieve one line of the server buffer.
ostring GetSessionTag() const
Return the tag associated with the given connection.
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.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetVersionConnection(OCI_Connection *con)
Return the highest Oracle version is supported by the connection.
void Commit()
Commit current pending changes.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetUserData(OCI_Connection *con, void *data)
Associate a pointer to user data to the given connection.
bool SetFormat(FormatType formatType, const ostring &format)
Set the format string for implicit string conversions of the given type.
void Break()
Perform an immediate abort of any currently Oracle OCI call on the given connection.
ostring GetDomain() const
Return the Oracle server Domain name of the connected database/service name.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetTAFHandler(OCI_Connection *con, POCI_TAF_HANDLER handler)
Set the Transparent Application Failover (TAF) user handler.
void Rollback()
Cancel current pending changes.
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetVersionServer(OCI_Connection *con)
Return the connected database server version.
unsigned int GetDefaultLobPrefetchSize() const
Return the default LOB prefetch buffer size for the connection.
ostring GetServerVersion() const
Return the connected database server string version.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetServerMinorVersion(OCI_Connection *con)
Return the minor version number of the connected database server.
ostring GetInstance() const
Return the Oracle server Instance name of the connected database/service name.
void EnableServerOutput(unsigned int bufsize, unsigned int arrsize, unsigned int lnsize)
Enable the server output.
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetServerName(OCI_Connection *con)
Return the Oracle server machine name of the connected database/service name.
ostring GetService() const
Return the Oracle server Service name of the connected database/service name.
ostring GetConnectionString() const
Return the name of the connected database/service name.
unsigned int GetServerMajorVersion() const
Return the major version number of the connected database server.
OCI_SYM_PUBLIC OCI_Timestamp *OCI_API OCI_GetInstanceStartTime(OCI_Connection *con)
Return the date and time (Timestamp) server instance start of the connected database/service name...
AnyPointer GetUserData()
Return the pointer to user data previously associated with the connection.
OCI_SYM_PUBLIC boolean OCI_API OCI_ServerEnableOutput(OCI_Connection *con, unsigned int bufsize, unsigned int arrsize, unsigned int lnsize)
Enable the server output.
void SetSessionTag(const ostring &tag)
Associate a tag to the given connection/session.
OCI_SYM_PUBLIC boolean OCI_API OCI_SetPassword(OCI_Connection *con, const otext *password)
Change the password of the logged user.
bool PingServer() const
Performs a round trip call to the server to confirm that the connection to the server is still valid...
Timestamp GetInstanceStartTime() const
Return the date and time (Timestamp) server instance start of the.
std::basic_string< otext, std::char_traits< otext >, std::allocator< otext > > ostring
string class wrapping the OCILIB otext * type and OTEXT() macros ( see Character sets ) ...
OCI_SYM_PUBLIC boolean OCI_API OCI_Commit(OCI_Connection *con)
Commit current pending changes.
bool GetAutoCommit() const
Indicates if auto commit is currently activated.
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetDatabase(OCI_Connection *con)
Return the name of the connected database/service name.
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetFormat(OCI_Connection *con, unsigned int type)
Return the format string for implicit string conversions of the given type.
bool GetServerOutput(ostring &line) const
Retrieve one line of the server buffer.
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetPassword(OCI_Connection *con)
Return the current logged user password.
Object identifying the SQL data type TIMESTAMP.
FailoverResult(* TAFHandlerProc)(Connection &con, FailoverRequest failoverRequest, FailoverEvent failoverEvent)
User callback for TAF event notifications.
Connection()
Default constructor.