#include <ConnectionParameters.hpp>
Public Member Functions | |
| ConnectionParameters (const std::vector< ControllerInfo > &ctrls, const std::wstring &db=DEFAULT_DB, const std::wstring &uname=DEFAULT_USER, const std::wstring &upass=DEFAULT_PASSWD, ConnectPolicy cp=DEFAULT_POLICY, bool persistentConnection=DEFAULT_CONNECTION_PERSISTENCY, bool retrieveSQLWarnings=DEFAULT_RETRIEVE_SQL_WARNINGS) throw (ConnectionException, UnexpectedException) | |
| Creates instance with a set of values:. | |
| bool | isValidDatabaseName (const std::wstring &, wchar_t &) const |
| Validates database name. | |
| bool | isValidHostName (const std::wstring &, wchar_t &) const |
| Validates host name. | |
| void | checkHostName (const std::wstring &) const throw (ConnectionException, UnexpectedException) |
| Checks the host name. | |
| const std::wstring & | checkDatabaseName (const std::wstring &) const throw (ConnectionException, UnexpectedException) |
| Checks the database name. | |
| std::wstring | getDatabaseName () const |
| Gives the database name. | |
| std::wstring | getUserName () const |
| Gives the user name. | |
| std::wstring | getUserPass () const |
| Gives the user password. | |
| AbstractControllerPool & | getControllerPool () |
| Gives the controller pool. | |
| void | releaseControllerPool () |
| Inform ControllerPoolManager that we don't need controller_pool anymore. | |
| bool | getPersistentConnection () const |
| Tell whether the connection must remain persistent. | |
| bool | getRetrieveSQLWarnings () const |
| Whether the controller should retrieve SQL warnings. | |
Static Public Attributes | |
| static const std::wstring | DEFAULT_USER |
| Default username = "user". | |
| static const std::wstring | DEFAULT_PASSWD |
| Default password = "". | |
| static const std::wstring | DEFAULT_DB |
| Default database name = "myDB". | |
| static const ConnectPolicy | DEFAULT_POLICY |
| Default policy = ROUND_ROBIN. | |
| static const bool | DEFAULT_CONNECTION_PERSISTENCY |
| Default for persistent connections value = false. | |
| static const bool | DEFAULT_RETRIEVE_SQL_WARNINGS |
| Default for retrieve SQL warnings = false. | |
This connection parameters will be used by the Connection class. It is a replacement for SequoiaUrl Java class
| CarobNS::ConnectionParameters::ConnectionParameters | ( | const std::vector< ControllerInfo > & | ctrls, | |
| const std::wstring & | db = DEFAULT_DB, |
|||
| const std::wstring & | uname = DEFAULT_USER, |
|||
| const std::wstring & | upass = DEFAULT_PASSWD, |
|||
| ConnectPolicy | cp = DEFAULT_POLICY, |
|||
| bool | persistentConnection = DEFAULT_CONNECTION_PERSISTENCY, |
|||
| bool | retrieveSQLWarnings = DEFAULT_RETRIEVE_SQL_WARNINGS | |||
| ) | throw (ConnectionException, UnexpectedException) |
Creates instance with a set of values:.
| ctrls | a list of controllers to connect to as a vector of ControllerInfo. | |
| db | name of the database (default to "user) | |
| uname | user name to use on this database (default to "") | |
| upass | user pass (default to "myDB") | |
| cp | controller pool policy for failover, one of enum ConnectPolicy (default to ROUND_ROBIN) | |
| persistentConnection | whether to create a persistent connection (default to false) | |
| retrieveSQLWarnings | whether SQL Warnings should be retrieved (default to false) |
| bool CarobNS::ConnectionParameters::isValidDatabaseName | ( | const std::wstring & | , | |
| wchar_t & | ||||
| ) | const |
Validates database name.
If invalid returns false and set param char to the first invalid character.
| bool CarobNS::ConnectionParameters::isValidHostName | ( | const std::wstring & | , | |
| wchar_t & | ||||
| ) | const |
Validates host name.
If invalid returns false and set param char to the first invalid character.
1.5.0