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