|
Q_DB* qDbInit |
( |
const char * |
dbtype, |
|
|
const char * |
addr, |
|
|
int |
port, |
|
|
const char * |
username, |
|
|
const char * |
password, |
|
|
const char * |
database, |
|
|
bool |
autocommit | |
|
) |
| | |
Initialize internal connector structure
- Parameters:
-
| dbtype | database server type. currently "MYSQL" is only supported |
| addr | ip or fqdn address. |
| port | port number |
| username | database username |
| password | database password |
| database | database server type. currently "MYSQL" is only supported |
| autocommit | sets autocommit mode on if autocommit is true, off if autocommit is false |
- Returns:
- a pointer of Q_DB structure in case of successful, otherwise returns NULL.
Q_DB *db = NULL;
db = qDbInit("MYSQL", "dbhost.qdecoder.org", 3306, "test", "secret", "sampledb", true);
if (db == NULL) {
printf("ERROR: Not supported database type.\n");
return -1;
}
Definition at line 111 of file qDatabase.c.
|