.TH "OpenDBX::Conn" 3 "Fri Sep 5 2014" "Version 1.4.6" "opendbx" \" -*- nroff -*- .ad l .nh .SH NAME OpenDBX::Conn \- .PP Encapsulates a connection to a database\&. .SH SYNOPSIS .br .PP .SS "Public Member Functions" .in +1c .ti -1c .RI "void \fBbind\fP (const char *database, const char *who='', const char *cred='', odbxbind method=ODBX_BIND_SIMPLE) throw ( std::exception )" .br .RI "\fIAuthenticates the user and selects the database using C style string parameters\&. \fP" .ti -1c .RI "void \fBbind\fP (const string &database, const string &who='', const string &cred='', odbxbind method=ODBX_BIND_SIMPLE) throw ( std::exception )" .br .RI "\fIAuthenticates the user and selects the database using C++ style string parameters\&. \fP" .ti -1c .RI "\fBConn\fP () throw ()" .br .RI "\fIThe default constructor for newly created connection objects without parameters\&. \fP" .ti -1c .RI "\fBConn\fP (const char *backend, const char *host='', const char *port='') throw ( std::exception )" .br .RI "\fICreates a connection object using C style string parameters\&. \fP" .ti -1c .RI "\fBConn\fP (const string &backend, const string &host='', const string &port='') throw ( std::exception )" .br .RI "\fICreates a connection object using C++ style string parameters\&. \fP" .ti -1c .RI "\fBConn\fP (const \fBConn\fP &ref) throw ()" .br .RI "\fICopy constructor\&. \fP" .ti -1c .RI "\fBStmt\fP \fBcreate\fP (const char *sql, unsigned long size=0, \fBStmt::Type\fP type=Stmt::Simple) throw ( std::exception )" .br .RI "\fICreates a statement object from a SQL text string using a C style buffer\&. \fP" .ti -1c .RI "\fBStmt\fP \fBcreate\fP (const string &sql, \fBStmt::Type\fP type=Stmt::Simple) throw ( std::exception )" .br .RI "\fICreates a statement object from a SQL text string using a C++ string\&. \fP" .ti -1c .RI "string & \fBescape\fP (const char *from, unsigned long fromlen, string &to) throw ( std::exception )" .br .RI "\fIEscapes potentially dangerous characters in user input using a C style buffer\&. \fP" .ti -1c .RI "string & \fBescape\fP (const string &from, string &to) throw ( std::exception )" .br .RI "\fIEscapes potentially dangerous characters in user input using a C++ style string parameter\&. \fP" .ti -1c .RI "void \fBfinish\fP () throw ( std::exception )" .br .RI "\fICleans up the connection object\&. \fP" .ti -1c .RI "bool \fBgetCapability\fP (odbxcap cap) throw ( std::exception )" .br .RI "\fITests if the database driver module does understand certain extensions\&. \fP" .ti -1c .RI "void \fBgetOption\fP (odbxopt option, void *value) throw ( std::exception )" .br .RI "\fIGets the value of a certain option provided by the database driver module\&. \fP" .ti -1c .RI "\fBConn\fP & \fBoperator=\fP (const \fBConn\fP &ref) throw ()" .br .RI "\fIAssigns a connection instance to another one\&. \fP" .ti -1c .RI "void \fBsetOption\fP (odbxopt option, void *value) throw ( std::exception )" .br .RI "\fISets a certain option provided by the database driver module\&. \fP" .ti -1c .RI "void \fBunbind\fP () throw ( std::exception )" .br .RI "\fIReleases the connection to the database and resets the authentication status\&. \fP" .ti -1c .RI "\fB~Conn\fP () throw ()" .br .RI "\fIDestroys the connection instance if no other references exist\&. \fP" .in -1c .SH "Detailed Description" .PP Encapsulates a connection to a database\&. .PP \fBAuthor:\fP .RS 4 Norbert Sendetzky norbert@linuxnetworks.de .RE .PP \fBVersion:\fP .RS 4 1\&.0 .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "OpenDBX::Conn::Conn ()" .PP The default constructor for newly created connection objects without parameters\&. This is method is provided to enable programmers to use connection objects as member variables of other classes\&. They are initialized at construction time of the encapsulating object when no values for backend, host and port are available yet\&. .PP It's necessary to replace the created object later on by a connection instance where the necessary parameters have been given via one of the other constructors\&. Calling one of the member functions of an instance created by the default constructor isn't possible and will throw an exception\&. .PP \fBReturns:\fP .RS 4 Empty connection instance .RE .PP \fBSee also:\fP .RS 4 \fBConn( const char*, const char*, const char* )\fP .PP \fBConn( const string&, const string&, const string& )\fP .RE .PP .SS "OpenDBX::Conn::Conn (const char *backend, const char *host = \fC''\fP, const char *port = \fC''\fP)std::exception" .PP Creates a connection object using C style string parameters\&. Initializes a new connection using the parameters \fIbackend\fP, \fIhost\fP and \fIport\fP, but doesn't open the connection to the database yet\&. This method allows C style strings as values for all parameters\&. Another constructor for C++ style strings is also available\&. It returns a new connection instance, which can be used to query options implemented by the driver or to create a statement\&. In case of an error, it throws an \fBOpenDBX\fP exception with error message, code and severity\&. .PP The parameter \fIbackend\fP is the name of the driver the \fBOpenDBX\fP library should use to connect to a database\&. The name must be one of the implemented and available drivers on the system and is case sensitive\&. All driver names are in lower case, e\&.g\&. 'mysql'\&. .PP Depending on the database driver, \fIhost\fP can have different meanings\&. Normally, it's the name or IP address of the server hosting the database server application\&. In case of serverless database implementations like SQLite it's the directory path where the database file is located\&. The path must contain the platform specific path separators like slash ('/') on Unix-like systems and backslash ('\\') on Windows systems\&. Also the path must end with the path separator like '/path/to/file/'\&. .PP Furthermore \fIport\fP can be the number or name the database server application is listening to\&. If a name instead of the number is allowed depends on the database client library but the number as string does always work\&. If an empty string is given, the default port of the database server application is used by the database client library\&. .PP \fBParameters:\fP .RS 4 \fIbackend\fP Name of the backend module to use .br \fIhost\fP Name or IP address of the database server .br \fIport\fP Name or number of the port used by the database server .RE .PP \fBReturns:\fP .RS 4 Connection instance .RE .PP \fBExceptions:\fP .RS 4 \fIstd::invalid_argument\fP If the object was only initialized by the default constructor .br \fI\fBOpenDBX::Exception\fP\fP If the underlying database library returns an error .RE .PP \fBSee also:\fP .RS 4 \fBConn( const string&, const string&, const string& )\fP .RE .PP .SS "OpenDBX::Conn::Conn (const string &backend, const string &host = \fC''\fP, const string &port = \fC''\fP)std::exception" .PP Creates a connection object using C++ style string parameters\&. Initializes a new connection using the parameters backend, host and port, but doesn't open the connection to the database yet\&. This method allows C++ style strings as values for all parameters\&. Another construtor for C style strings is also available\&. It returns a new connection instance, which can be used to query options implemented by the driver or to create a statement\&. In case of an error, it throws an \fBOpenDBX\fP exception with error message, code and severity\&. .PP The parameter \fIbackend\fP is the name of the driver the \fBOpenDBX\fP library should use to connect to a database\&. The name must be one of the implemented and available drivers on the system and is case sensitive\&. All driver names are in lower case, e\&.g\&. 'mysql'\&. .PP Depending on the database driver, \fIhost\fP can have different mearings\&. Normally, it's the name or IP address of the server hosting the database server application\&. In case of serverless database implementations like SQLite it's the directory path where the database file is located\&. The path must contain the platform specific path separators like slash ('/') on Unix-like systems and backslash ('\\') on Windows systems\&. Also the path must end with the path separator like '/path/to/file/'\&. .PP Furthermore \fIport\fP can be the number or name the database server application is listening to\&. If a name instead of the number is allowed depends on the database client library but the number as string does always work\&. If an empty string is given, the default port of the database server application is used by the database client library\&. .PP \fBParameters:\fP .RS 4 \fIbackend\fP Name of the backend module to use .br \fIhost\fP Name or IP address of the database server .br \fIport\fP Name or number of the port used by the database server .RE .PP \fBReturns:\fP .RS 4 Connection instance .RE .PP \fBExceptions:\fP .RS 4 \fIstd::invalid_argument\fP If the object was only initialized by the default constructor .br \fI\fBOpenDBX::Exception\fP\fP If the underlying database library returns an error .RE .PP \fBSee also:\fP .RS 4 \fBConn( const char*, const char*, const char* )\fP .RE .PP .SS "OpenDBX::Conn::~Conn ()" .PP Destroys the connection instance if no other references exist\&. Each connection object uses a reference counter to remember if the connection is shared with other objects\&. If this isn't the case or if this object is the last one referencing the connection, the connection is closed and the allocated memory is freed\&. .SS "OpenDBX::Conn::Conn (const \fBConn\fP &ref)" .PP Copy constructor\&. Enables the transfer of the internal state of an object \fIref\fP of the same type to this object\&. Both objects share the same database connection and the reference counter afterwards\&. The reference counter is incremented each time an object is copied and will be decremented if it is destroyed\&. .PP \fBParameters:\fP .RS 4 \fIref\fP Original connection object instance .RE .PP .SH "Member Function Documentation" .PP .SS "void OpenDBX::Conn::bind (const char *database, const char *who = \fC''\fP, const char *cred = \fC''\fP, odbxbindmethod = \fCODBX_BIND_SIMPLE\fP)std::exception" .PP Authenticates the user and selects the database using C style string parameters\&. After initializing the object instance with one of the constructors taking a backend, host and port string as parameter, it's necessary to authenticate the user and select a database\&. Depending on the database client library, it also establishes the connection to the database server\&. This method accepts C style strings for the database name, the user name and the password\&. .PP The first parameter, the name of the database will be used to select the database all further commands are operating on\&. The database is the container for the tables, views, etc\&., which store the records and provide access to them\&. .PP Authentication is done in most cases by a combination of a user name and a password\&. If the user name is known by the database server and the supplied password matches with the stored one, the database server will allow the user to operate on the selected database and its tables provided the user has permissions to read and/or modify the content\&. .PP The \fImethod\fP parameter can be used to select different methods of authentication\&. At the moment, only simple authentication (ODBX_BIND_SIMPLE) with user name and password is available\&. .PP \fBParameters:\fP .RS 4 \fIdatabase\fP Name of the database managed by the database server .br \fIwho\fP Name of the user account known by the database server .br \fIcred\fP Necessary credential which belongs to the user account .br \fImethod\fP Method used for authentication .RE .PP \fBExceptions:\fP .RS 4 \fIstd::invalid_argument\fP If the object was only initialized by the default constructor .br \fI\fBOpenDBX::Exception\fP\fP If the underlying database library returns an error .RE .PP .SS "void OpenDBX::Conn::bind (const string &database, const string &who = \fC''\fP, const string &cred = \fC''\fP, odbxbindmethod = \fCODBX_BIND_SIMPLE\fP)std::exception" .PP Authenticates the user and selects the database using C++ style string parameters\&. After initializing the object instance with one of the constructors taking a backend, host and port string as parameter, it's necessary to authenticate the user and select a database\&. Depending on the database client library, it also establishes the connection to the database server\&. This method accepts C++ style strings for the database name, the user name and the password\&. .PP The first parameter, the name of the database will be used to select the database all further commands are operating on\&. The database is the container for the tables, views, etc\&., which store the records and provide access to them\&. .PP Authentication is done in most cases by a combination of a user name and a password\&. If the user name is known by the database server and the supplied password matches with the stored one, the database server will allow the user to operate on the selected database and its tables provided the user has permissions to read and/or modify the content\&. .PP The \fImethod\fP parameter can be used to select different methods of authentication\&. At the moment, only simple authentication (ODBX_BIND_SIMPLE) with user name and password is available\&. .PP \fBParameters:\fP .RS 4 \fIdatabase\fP Name of the database managed by the database server .br \fIwho\fP Name of the user account known by the database server .br \fIcred\fP Necessary credential which belongs to the user account .br \fImethod\fP Method used for authentication .RE .PP \fBExceptions:\fP .RS 4 \fIstd::invalid_argument\fP If the object was only initialized by the default constructor .br \fI\fBOpenDBX::Exception\fP\fP If the underlying database library returns an error .RE .PP .SS "\fBStmt\fP OpenDBX::Conn::create (const char *sql, unsigned longsize = \fC0\fP, \fBStmt::Type\fPtype = \fCStmt::Simple\fP)std::exception" .PP Creates a statement object from a SQL text string using a C style buffer\&. This method returns an instance of the \fBStmt\fP class that contains the statement sent to the database server later on\&. Currently, only simple statements are supported, which are sent to the database server for parsing and returning the result after calling \fBStmt::execute()\fP\&. Later on also prepared statements will be possible which are parsed by the database server when creating the object and only the parameters will be sent to the database server on execution\&. This can speed up processing especially if the statement is executed multiple times with different content for the parameters\&. .PP The parameter named \fIsql\fP must contain the SQL text string that should be sent to the database server for execution\&. It have to be a C style buffer in this case\&. For a reference of valid SQL statements, please have a look at the documentation of your database server\&. .PP The length of the statement excluding the trailing '0' byte should be given via the second parameter \fIsize\fP\&. If the length of the statement is unknown, you can also supply zero (0) as size value which is also the default value if you hand over only one parameter\&. In this case, the length of the string is calculated internally by this function before the statement is given to the native database library\&. .PP Via the last parameter it can be selected how the statement should be treated internally by the \fBOpenDBX\fP and the native database library\&. Currently, only simple processing is available which sends complete SQL statements including its parameters as string to the database server for parsing and execution\&. Later on, also prepared statement handling will be available which parses the statements first and sends only the parameters to the server before execution\&. This parameter is also optional\&. .PP The returned object is representing the given statement, which can be executed later on\&. The statement is only valid for the current connection and as soon as the connection gets invalid or is closed, working with this object will throw an error\&. .PP \fBParameters:\fP .RS 4 \fIsql\fP SQL text string containing a valid statement understood by the database server .br \fIsize\fP Size of the SQL text string in bytes .br \fItype\fP Type of statement object that should be created .RE .PP \fBReturns:\fP .RS 4 Statement instance bound to this connection .RE .PP \fBExceptions:\fP .RS 4 \fIstd::invalid_argument\fP If the object was only initialized by the default constructor .br \fI\fBOpenDBX::Exception\fP\fP If the underlying database library returns an error .RE .PP \fBSee also:\fP .RS 4 \fBStmt\fP .RE .PP .SS "\fBStmt\fP OpenDBX::Conn::create (const string &sql, \fBStmt::Type\fPtype = \fCStmt::Simple\fP)std::exception" .PP Creates a statement object from a SQL text string using a C++ string\&. This method returns an instance of the \fBStmt\fP class that contains the statement sent to the database server later on\&. Currently, only simple statements are supported, which are sent to the database server for parsing and returning the result after calling \fBStmt::execute()\fP\&. Later on also prepared statements will be possible which are parsed by the database server when creating the object and only the parameters will be sent to the database server on execution\&. This can speed up processing especially if the statement is executed multiple times with different content for the parameters\&. .PP The parameter named \fIsql\fP must contain the SQL text string that should be sent to the database server for execution\&. It have to be a C++ style string in this case\&. For a reference of valid SQL statements, please have a look at the documentation of your database server\&. .PP Via the last parameter \fItype\fP it can be selected how the statement should be treated internally by the \fBOpenDBX\fP and the native database library\&. Currently, only simple processing is available which sends complete SQL statements including its parameters as string to the database server for parsing and execution\&. Later on, also prepared statement handling will be available which parses the statements first and sends only the parameters to the server before execution\&. This parameter is also optional\&. .PP The returned object is representing the given statement, which can be executed later on\&. The statement is only valid for the current connection and as soon as the connection gets invalid or is closed, working with this object will throw an error\&. .PP \fBParameters:\fP .RS 4 \fIsql\fP SQL text string containing a valid statement understood by the database server .br \fItype\fP Type of statement object that should be created .RE .PP \fBReturns:\fP .RS 4 Statement instance bound to this connection .RE .PP \fBExceptions:\fP .RS 4 \fIstd::invalid_argument\fP If the object was only initialized by the default constructor .br \fI\fBOpenDBX::Exception\fP\fP If the underlying database library returns an error .RE .PP \fBSee also:\fP .RS 4 \fBStmt\fP .RE .PP .SS "string& OpenDBX::Conn::escape (const char *from, unsigned longfromlen, string &to)std::exception" .PP Escapes potentially dangerous characters in user input using a C style buffer\&. For preventing SQL injection attacks which can have desasterous effects, all text input that will be part of an SQL statement must be escaped\&. This does also apply to user content that is already stored in the database and should be copied to another record or stored again as the escaping is removed before the database server writes the content to disk\&. .PP The first parameter must contain the character sequence that should be escaped as C style string\&. This string itself won't be modified by this method\&. .PP The escaped string will be written to the third parameter named \fIto\fP, which have to be also an C++ style string\&. After transforming the input to an escaped string, the result may be more then twice the size of the original input\&. The additional escape sequences aren't stored in the database column so only the original string will be written to the disk\&. .PP A C++ reference of the third parameter containing the escaped string afterwards is also returned by this method to providing the possibility to write more elegant code\&. .PP \fBParameters:\fP .RS 4 \fIfrom\fP Input string with which may contain dangerous characters .br \fIfromlen\fP Size of the input string to escape in bytes .br \fIto\fP String instance where the escaped characters should be written to .RE .PP \fBReturns:\fP .RS 4 Reference to the second parameter containing the escaped characters .RE .PP \fBExceptions:\fP .RS 4 \fIstd::invalid_argument\fP If the object was only initialized by the default constructor .br \fI\fBOpenDBX::Exception\fP\fP If the underlying database library returns an error .RE .PP .SS "string& OpenDBX::Conn::escape (const string &from, string &to)std::exception" .PP Escapes potentially dangerous characters in user input using a C++ style string parameter\&. For preventing SQL injection attacks which can have desasterous effects, all text input that will be part of an SQL statement must be escaped\&. This does also apply to user content that is already stored in the database and should be copied to another record or stored again as the escaping is removed before the database server writes the content to disk\&. .PP The first parameter must contain the character sequence that should be escaped as C++ style string\&. This string itself won't be modified by this method\&. .PP The escaped string will be written to the third parameter named \fIto\fP, which have to be also an C++ style string\&. After transforming the input to an escaped string, the result may be more then twice the size of the original input\&. The additional escape sequences aren't stored in the database column so only the original string will be written to the disk\&. .PP A C++ reference of the second parameter containing the escaped string afterwards is also returned by this method too, providing the possibility to write more elegant code\&. .PP \fBParameters:\fP .RS 4 \fIfrom\fP Input string with which may contain dangerous characters .br \fIto\fP String instance where the escaped characters should be written to .RE .PP \fBReturns:\fP .RS 4 Reference to the second parameter containing the escaped characters .RE .PP \fBExceptions:\fP .RS 4 \fIstd::invalid_argument\fP If the object was only initialized by the default constructor .br \fI\fBOpenDBX::Exception\fP\fP If the underlying database library returns an error .RE .PP .SS "void OpenDBX::Conn::finish ()std::exception" .PP Cleans up the connection object\&. .PP \fBExceptions:\fP .RS 4 \fIstd::invalid_argument\fP If the object was only initialized by the default constructor .br \fI\fBOpenDBX::Exception\fP\fP If the underlying database library returns an error .RE .PP .SS "bool OpenDBX::Conn::getCapability (odbxcapcap)std::exception" .PP Tests if the database driver module does understand certain extensions\&. The \fBOpenDBX\fP library consists of a basic set of functions that must be implemented by all drivers and optional sets for additional functionality\&. This method allows an application to ask the driver selected by the first parameter of the constructor of this object if it supports one or more optional sets\&. The available sets and its constants are: .PP .IP "\(bu" 2 ODBX_CAP_BASIC .br The core function set which have to be implemented by all backends\&. It consists of all functions necessary to connect to, send textual queries to and process simple results returned from the database server as well as error handling functions\&. .IP "\(bu" 2 ODBX_CAP_LO .br The function set for handling large objects whose content isn't accessible by the basic function\&. Currently, Firebird/Interbase and Oracle requires using the LOB functions\&. .PP .PP The basic set makes sure that all drivers can handle connections to the databases, send statements and retrieve results\&. It's supported by all drivers and usually don't have to be checked\&. .PP Some databases client libraries provide the content of large objects not via the basic functions\&. Instead, the \fBResult::fieldValue()\fP method returns only a handle to the large object and reading or modifying the content of this data object requires calling additional methods\&. .PP \fBParameters:\fP .RS 4 \fIcap\fP Constant of the capability .RE .PP \fBReturns:\fP .RS 4 True if supported, false if not .RE .PP \fBExceptions:\fP .RS 4 \fIstd::invalid_argument\fP If the object was only initialized by the default constructor .br \fI\fBOpenDBX::Exception\fP\fP If the underlying database library returns an error .RE .PP .SS "void OpenDBX::Conn::getOption (odbxoptoption, void *value)std::exception" .PP Gets the value of a certain option provided by the database driver module\&. It asks the backend module for implemented options and their current values\&. This function can be used at every stage and its primary use is to find out supported features of the backend module\&. This features can be enable with \fBsetOption()\fP before the connection to the database server is established by calling \fBbind()\fP\&. .PP There are several option values defined as named constants in the opendbx/api\&.h header file\&. A few of them are for informational purpose only while most of the options can also be set to different values by \fBsetOption()\fP to change the behavior of the backend module\&. These options are: .PP .IP "\(bu" 2 ODBX_OPT_API_VERSION .br The API version implemented by the backend\&. It returns a five digit number representing the API version of the backend module in the form XYYZZ where X is the major number, YY the revision and ZZ the minor number of the API\&. .IP "\(bu" 2 ODBX_OPT_THREAD_SAFE .br If it is safe to use this backend and especially the native database client library in an application which uses threads where more than one thread opens database connections via the \fBOpenDBX\fP library\&. .IP "\(bu" 2 ODBX_OPT_TLS .br The database client library may support transmitting all data securely by encrypting the network traffic via SSL or TLS\&. .IP "\(bu" 2 ODBX_OPT_MULTI_STATEMENTS .br The database server may be able to support multiple SQL statements in one string sent to the database\&. .IP "\(bu" 2 ODBX_OPT_PAGED_RESULTS .br All database servers and client libraries are able to transfer the records row by row\&. Some of them can also transfer multiple rows or even all at once to minimize server load, network traffic and latency\&. The downside of this is an increased memory consumption\&. .IP "\(bu" 2 ODBX_OPT_COMPRESS .br Support of compressed network traffic between database client and server\&. This can lead to higher throughput if the network is the bottleneck\&. .IP "\(bu" 2 ODBX_OPT_MODE .br Some database servers support different modes of operation, e\&.g\&. modes for compliance to other SQL implementations or completely different query languages\&. .PP .PP The parameter \fIvalue\fP must be a pointer to an integer variable where the backend module will store the result for the supplied option\&. If it's not stated otherwise, the value assigned to the this parameter will be of boolean nature and therefore is ODBX_ENABLE for a supported option or ODBX_DISABLE for an option which isn't supported\&. .PP \fBParameters:\fP .RS 4 \fIoption\fP Constant of the option .br \fIvalue\fP Pointer to memory where the result is stored .RE .PP \fBExceptions:\fP .RS 4 \fIstd::invalid_argument\fP If the object was only initialized by the default constructor .br \fI\fBOpenDBX::Exception\fP\fP If the underlying database library returns an error .RE .PP .SS "\fBConn\fP& OpenDBX::Conn::operator= (const \fBConn\fP &ref)" .PP Assigns a connection instance to another one\&. Assigns the internal state of an object \fIref\fP of the same type to this object\&. Both objects share the same database connection and the reference counter afterwards\&. The reference counter is incremented each time an object is copied and will be decremented if it is destroyed\&. .PP \fBParameters:\fP .RS 4 \fIref\fP Connection instance .RE .PP \fBReturns:\fP .RS 4 Connection reference of this instance .RE .PP .SS "void OpenDBX::Conn::setOption (odbxoptoption, void *value)std::exception" .PP Sets a certain option provided by the database driver module\&. Changes the value of the specified option in the backend module or the native database library\&. Before trying to set an option, it should be tested with \fBgetOption()\fP first to ensure that it is supported by the backend\&. Almost all options need to be set before connecting to the database server using \fBbind()\fP to take any effect\&. .PP There are several option values defined as named constants in the opendbx/api\&.h header file\&. The possible options are: .PP .IP "\(bu" 2 ODBX_OPT_TLS .br Use encryption to transmit all data securely over the network via SSL or TLS\&. This option can be set to ODBX_TLS_NEVER (the default value) to prevent encrpytion, ODBX_TLS_ALWAYS to enforce encryption and to fail if it can't be used between the client library and the server or ODBX_TLS_TRY to use encryption if possible with the option to fall back to a connection which isn't encrypted\&. .IP "\(bu" 2 ODBX_OPT_MULTI_STATEMENTS .br Enables the database server to accept multiple statements in one string to the database if the value of value is set to ODBX_ENABLE\&. Although, it might be possible to disable it by setting it to ODBX_DISABLE\&. .IP "\(bu" 2 ODBX_OPT_PAGED_RESULTS .br All database servers and client libraries are able to transfer the records row by row\&. Some of them can also transfer multiple rows or even all at once to minimize server load, network traffic and latency\&. The downside of this is an increased memory consumption\&. If paged results are supported by the backend, passing positive values will fetch the specified number of records at once from the database server\&. The value of zero ('0') is special in this case because it asks the backend module to retrieve all records at once\&. .IP "\(bu" 2 ODBX_OPT_COMPRESS .br Enable compressed network traffic between database client and server\&. This can maximize the throughput if the network is the bottleneck\&. Pass an integer variable with ODBX_ENABLE to enable compression or with ODBX_DISABLE to disable it for this connection\&. .IP "\(bu" 2 ODBX_OPT_MODE .br Some database servers support different modes of operation, e\&.g\&. modes for compliance to other SQL implementations or completely different query languages\&. The value for this option must point to a zero terminated string\&. .PP .PP If not stated otherwise, the type of the variable passed to the second parameter named \fIvalue\fP must be an integer pointer\&. Its values must be in the range specified by the option being changed\&. .PP \fBParameters:\fP .RS 4 \fIoption\fP Constant of the option .br \fIvalue\fP Pointer to memory which contains the new value .RE .PP \fBExceptions:\fP .RS 4 \fIstd::invalid_argument\fP If the object was only initialized by the default constructor .br \fI\fBOpenDBX::Exception\fP\fP If the underlying database library returns an error .RE .PP .SS "void OpenDBX::Conn::unbind ()std::exception" .PP Releases the connection to the database and resets the authentication status\&. .PP \fBExceptions:\fP .RS 4 \fIstd::invalid_argument\fP If the object was only initialized by the default constructor .br \fI\fBOpenDBX::Exception\fP\fP If the underlying database library returns an error .RE .PP .SH "Author" .PP Generated automatically by Doxygen for opendbx from the source code\&.