ConnectString Class ReferenceClass for parsing parameters from connect string.
More...
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Public Member Functions | |
| ConnectString (const char *pStr) | |
| Constructor. | |
| std::string | dbname () const |
| Get name of database. | |
| std::string | getParam (const char *pParam) const |
| Get value of custom parameter. | |
| int | getParamCount () const |
| Get number of parsed params. | |
| std::string | host () const |
| Get hostname of rdbms. | |
| std::string | password () const |
| Get password. | |
| std::string | port () const |
| Get TCP/IP port. | |
| std::string | username () const |
| Get username. | |
Connect string contains name=value pairs that describes how to connect to database.
Standard names:
Spaces in names and values can be escaped using SQL syntax, for example:
Driver searches for dbname first and if found passes all its contents as DSN=<value> to SQLConnect. If not found, then driver searches for odbcparams and passes its contents to SQLConnect. If odbcparams is not found then driver passes full connect string to SQLConnect.
You can control how driver should send queries to database using unicode setting. Default behaviour is to try to convert queries to unicode and call SQLExecDirectW with unicode string. If conversion cannot be performed then query is passed unmodified to SQLExecDirect. Source encoding of query is determined from DbConnection::mConvSpecs::mDbCharset.
If unicode is set to 0, then driver does not try to convert query to unicode but passes it directly to SQLExecDirect. If unicode is set to 1, then driver tries to convert query to unicode and if failed then handleError with DBA_DB_ERROR code is called (in case when driver is used by SQLArchive this causes DatabaseException to be thrown).
If driver retrieve unicode data from database then it tries to convert it to encoding specified in DbResult::mConvSpecs::mDbCharset. If this is not set to dba::ConvSpec::UTF8 then and OS does not support requested conversion, then handleError with DBA_DB_ERROR code is called (in case when driver is used by SQLArchive this causes DatabaseException to be thrown).
If driver retrieve non-unicode data from database then it returns it to getString unmodified.
Examples of use:
dbname=mydsn odbcparams="DSN=mydsn" unicode=0 FILEDSN=myfiledsn
See postgres documentation for meaning of those parameters.
|
|
Constructor.
|
|
|
Get name of database.
|
|
|
Get value of custom parameter.
|
|
|
Get hostname of rdbms.
|
|
|
Get password.
|
|
|
Get TCP/IP port.
|
|
|
Get username.
|
| Documentation |
|---|
| Quick start |
| Examples |
| Search |
| API Documentation |
|---|
| Class hierarchy |
| Member index |
| API Reference |
| Store filters |
| Store table macros |