#include <connection.h>
Public Methods | |
connection (void) | |
Creates a new connection class instance. | |
connection (IN const char *service_name, IN const char *login, IN const char *password, IN OPTIONAL unsigned long env_mode=OCI_OBJECT, IN OPTIONAL bool non_blocking_mode=false) | |
Creates a new connection class instance and attempts to attach and to authenticate to an Oracle server. | |
~connection () | |
connection class destructor. | |
void | open (IN const char *service_name, IN const char *login, IN const char *password, IN OPTIONAL unsigned long env_mode=OCI_OBJECT, IN OPTIONAL bool non_blocking_mode=false) |
Attempts to attach and to authenticate to an Oracle server. | |
void | close (void) |
Terminates user session and detaches from an Oracle server. | |
void | execute (IN const char *sql_block, IN OPTIONAL int sql_len=-1) |
Immediately executes a SQL (or PL/SQL) statement. | |
statement * | prepare (IN const char *sql_block, IN OPTIONAL int sql_len=-1) |
Prepares (but doesn't executes) a SQL (or PL/SQL) statement. | |
resultset * | select (IN const char *select, IN OPTIONAL int select_len=-1) |
Executes SQL select statement and returns fetched data as a resultset. | |
void | commit (void) |
Commits changes. | |
void | rollback (void) |
Rollbacks changed. | |
Friends | |
class | statement |
class | parameter |
class | resultset |
class | column |
|
Creates a new connection class instance and attempts to attach and to authenticate to an Oracle server.
Calls open to establish the connection. Check open() for more information. If close method is not called connection will be automatically closed when class instance is deleted. After close connection could be reused with subsequent open call. |
|
connection class destructor.
If connection is still opened close will be automatically called. |
|
Attempts to attach and to authenticate to an Oracle server.
Database server name, login and password should be all in ANSI and are all required (that is they cannot be NULLs). Unicode support is planned because of Oracle OCI 9. In case of an error an exception will be thrown. Connection should not be already opened otherwise resources will be leaked. In debug builds this rule is checked with assert statement. |
|
Terminates user session and detaches from an Oracle server.
After close connection could be reused with subsequent open call. |
|
Immediately executes a SQL (or PL/SQL) statement.
execute method could be used to run a DDL (data-definition language) statement, such as create table or drop table or any other SQL statement that could be called with no parameters and which doesn't return any result (for example insert or update). Internally execute prepares the statement, calls statement::execute, and, finally calls statement::release. In case of an error an exception will be thrown. No cleanup is necessary after execute has been called. |
|
Prepares (but doesn't executes) a SQL (or PL/SQL) statement.
prepare method could be used to prepare a SQL (or PL/SQL) statement so parameters could be bound and/or statement could be executed more than once. For example a same insert statement taking its data from bound variables could be executed several times with only changing values of the bound variables. statement::release should be called when statement is no longer needed. |
|
Executes SQL select statement and returns fetched data as a resultset.
select method is the fastest way to execute SQL select statement. In case of an error an exception will be thrown. resultset::release should be called when resultset is no longer needed. |