23 #include "ocilibcpp/types.hpp"
41 Environment::GetEnvironmentHandle()
53 connection, name.c_str(), changeTypes.GetValues(),
54 static_cast<POCI_NOTIFY> (handler !=
nullptr ? Environment::NotifyHandler :
nullptr),
58 Environment::GetEnvironmentHandle()
61 Environment::SetUserCallback<Subscription::NotifyHandlerProc>(
static_cast<OCI_Subscription*
>(*
this), handler);
66 Environment::SetUserCallback<Subscription::NotifyHandlerProc>(
static_cast<OCI_Subscription*
>(*
this),
nullptr);
100 Environment::GetEnvironmentHandle()
A connection or session with a specific database.
Object used for executing SQL or PL/SQL statement and returning the produced results.
void Execute(const ostring &sql)
Prepare and execute a SQL statement or PL/SQL block.
void Watch(const ostring &sql)
Add a SQL query to monitor.
void Unregister()
Unregister a previously registered notification.
Subscription()
Default constructor.
void Register(const Connection &connection, const ostring &name, ChangeTypes changeTypes, NotifyHandlerProc handler, unsigned int port=0, unsigned int timeout=0)
Register a notification against the given database.
Connection GetConnection() const
Return the connection associated with a subscription handle.
unsigned int GetTimeout() const
Return the timeout of the given registered subscription.
ostring GetName() const
Return the name of the given registered subscription.
unsigned int GetPort() const
Return the port used by the notification.
Template Flags template class providing some type safety to some extends for manipulating flags set v...
void(* POCI_NOTIFY)(OCI_Event *event)
Database Change Notification User callback prototype.
struct OCI_Subscription OCI_Subscription
OCILIB encapsulation of Oracle DCN notification.
OCI_SYM_PUBLIC const otext *OCI_API OCI_SubscriptionGetName(OCI_Subscription *sub)
Return the name of the given registered subscription.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_SubscriptionGetTimeout(OCI_Subscription *sub)
Return the timeout of the given registered subscription.
OCI_SYM_PUBLIC OCI_Connection *OCI_API OCI_SubscriptionGetConnection(OCI_Subscription *sub)
Return the connection handle associated with a subscription handle.
OCI_SYM_PUBLIC OCI_Subscription *OCI_API OCI_SubscriptionRegister(OCI_Connection *con, const otext *name, unsigned int type, POCI_NOTIFY handler, unsigned int port, unsigned int timeout)
Register a notification against the given database.
OCI_SYM_PUBLIC boolean OCI_API OCI_SubscriptionAddStatement(OCI_Subscription *sub, OCI_Statement *stmt)
Add a statement to the notification to monitor.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_SubscriptionGetPort(OCI_Subscription *sub)
Return the port used by the notification.
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 )