|
#include <DatabaseConnectionString.h>
Public Member Functions | |
| DatabaseConnectionString (const String &connectionString="") | |
| DatabaseConnectionString (const DatabaseConnectionString &cs)=default | |
| DatabaseConnectionString & | operator= (const DatabaseConnectionString &cs)=default |
| String | toString () const |
| const String & | driverName () const |
| const String & | hostName () const |
| const String & | userName () const |
| const String & | password () const |
| const String & | databaseName () const |
| const String & | schema () const |
| uint16_t | portNumber () const |
| void | userName (const String &user) |
| void | password (const String &pass) |
| String | parameter (const String &name) const |
| bool | empty () const |
Protected Member Functions | |
| void | parse () |
Database Connection String
Database connection string includes driver name ('odbc', 'sqlite3', etc) as a protocol name, and username, password, server name in a traditional form. Database name is optionally defined after server name and '/' delimiter.
Example: drivername://[username:password]@servername[:port]/databasename
Some driver-specific parameters may be passed after '?': drivername://username:password@servername/databasename?timeout=10&reconnect=30
This class is thread-safe.
|
inlineexplicit |
Constructor
| connectionString | Database connection string |
|
default |
Copy constructor
| cs | Database connection string object to copy from |
|
inline |
Returns database name
|
inline |
Returns driver name
| bool sptk::DatabaseConnectionString::empty | ( | ) | const |
Is connection string empty?
|
inline |
Returns host name
|
default |
Assignment
| cs | Database connection string object to copy from |
Return optional parameter value
| name | Parameter name |
|
protected |
Parses connection string
|
inline |
Returns user password
|
inline |
Set new password
| pass | New password |
|
inline |
Returns server port number
|
inline |
Returns schema name
| String sptk::DatabaseConnectionString::toString | ( | ) | const |
Returns connection string
|
inline |
Returns user name
|
inline |
Set new user name
| user | New user name |