|
Functions | |
| Q_DB * | qDbInit (const char *dbtype, const char *addr, int port, const char *username, const char *password, const char *database, bool autocommit) |
| Under-development. | |
| bool | qDbOpen (Q_DB *db) |
| Under-development. | |
| bool | qDbClose (Q_DB *db) |
| Under-development. | |
| bool | qDbFree (Q_DB *db) |
| Under-development. | |
| const char * | qDbGetError (Q_DB *db, unsigned int *errorno) |
| Under-development. | |
| bool | qDbPing (Q_DB *db) |
| Under-development. | |
| bool | qDbGetLastConnStatus (Q_DB *db) |
| Under-development. | |
| int | qDbExecuteUpdate (Q_DB *db, const char *query) |
| Under-development. | |
| int | qDbExecuteUpdatef (Q_DB *db, const char *format,...) |
| Under-development. | |
| Q_DBRESULT * | qDbExecuteQuery (Q_DB *db, const char *query) |
| Under-development. | |
| Q_DBRESULT * | qDbExecuteQueryf (Q_DB *db, const char *format,...) |
| Under-development. | |
| bool | qDbResultNext (Q_DBRESULT *result) |
| Under-development. | |
| bool | qDbResultFree (Q_DBRESULT *result) |
| Under-development. | |
| int | qDbGetCols (Q_DBRESULT *result) |
| Under-development. | |
| int | qDbGetRows (Q_DBRESULT *result) |
| Under-development. | |
| int | qDbGetRow (Q_DBRESULT *result) |
| Retrieves the current row number. | |
| const char * | qDbGetStr (Q_DBRESULT *result, const char *field) |
| Under-development. | |
| const char * | qDbGetStrAt (Q_DBRESULT *result, int idx) |
| Under-development. | |
| int | qDbGetInt (Q_DBRESULT *result, const char *field) |
| Under-development. | |
| int | qDbGetIntAt (Q_DBRESULT *result, int idx) |
| Under-development. | |
| bool | qDbBeginTran (Q_DB *db) |
| Under-development. | |
| bool | qDbEndTran (Q_DB *db, bool commit) |
| Under-development. | |
| bool | qDbCommit (Q_DB *db) |
| Under-development. | |
| bool | qDbRollback (Q_DB *db) |
| Under-development. | |
[include order at your source codes] #include "mysql.h" #include "qDecoder.h"
Not documented yet, please refer below sample codes.
Q_DB *db = NULL; Q_DBRESULT *result = NULL; db = qDbInit("MYSQL", "dbhost.qdecoder.org", 3306, "test", "secret", "sampledb", true); if (db == NULL) { printf("ERROR: Not supported database type.\n"); return -1; } // try to connect if (qDbOpen(db) == false) { printf("WARNING: Can't connect to database.\n"); return -1; } // get results result = qDbExecuteQuery(db, "SELECT name, population FROM City"); if (result != NULL) { printf("COLS : %d , ROWS : %d\n", qDbGetCols(result), qDbGetRows(result)); while (qDbResultNext(result) == true) { char *pszName = qDbGetValue(result, "name"); int nPopulation = qDbGetInt(result, "population"); printf("Country : %s , Population : %d\n", pszName, nPopulation); } qDbResultFree(result); } // close connection qDbClose(db); // free db object qDbFree(db);
| Q_DB* qDbInit | ( | const char * | dbtype, | |
| const char * | addr, | |||
| int | port, | |||
| const char * | username, | |||
| const char * | password, | |||
| const char * | database, | |||
| bool | autocommit | |||
| ) |
| bool qDbOpen | ( | Q_DB * | db | ) |
Under-development.
| bool qDbClose | ( | Q_DB * | db | ) |
Under-development.
| bool qDbFree | ( | Q_DB * | db | ) |
Under-development.
| const char* qDbGetError | ( | Q_DB * | db, | |
| unsigned int * | errorno | |||
| ) |
Under-development.
| bool qDbPing | ( | Q_DB * | db | ) |
Under-development.
| bool qDbGetLastConnStatus | ( | Q_DB * | db | ) |
Under-development.
| int qDbExecuteUpdate | ( | Q_DB * | db, | |
| const char * | query | |||
| ) |
Under-development.
| int qDbExecuteUpdatef | ( | Q_DB * | db, | |
| const char * | format, | |||
| ... | ||||
| ) |
Under-development.
| Q_DBRESULT* qDbExecuteQuery | ( | Q_DB * | db, | |
| const char * | query | |||
| ) |
Under-development.
| Q_DBRESULT* qDbExecuteQueryf | ( | Q_DB * | db, | |
| const char * | format, | |||
| ... | ||||
| ) |
Under-development.
| bool qDbResultNext | ( | Q_DBRESULT * | result | ) |
Under-development.
| bool qDbResultFree | ( | Q_DBRESULT * | result | ) |
Under-development.
| int qDbGetCols | ( | Q_DBRESULT * | result | ) |
Under-development.
| int qDbGetRows | ( | Q_DBRESULT * | result | ) |
Under-development.
| int qDbGetRow | ( | Q_DBRESULT * | result | ) |
Retrieves the current row number.
| const char* qDbGetStr | ( | Q_DBRESULT * | result, | |
| const char * | field | |||
| ) |
Under-development.
| const char* qDbGetStrAt | ( | Q_DBRESULT * | result, | |
| int | idx | |||
| ) |
Under-development.
| int qDbGetInt | ( | Q_DBRESULT * | result, | |
| const char * | field | |||
| ) |
Under-development.
| int qDbGetIntAt | ( | Q_DBRESULT * | result, | |
| int | idx | |||
| ) |
Under-development.
| bool qDbBeginTran | ( | Q_DB * | db | ) |
Under-development.
| bool qDbEndTran | ( | Q_DB * | db, | |
| bool | commit | |||
| ) |
Under-development.
| bool qDbCommit | ( | Q_DB * | db | ) |
Under-development.
| bool qDbRollback | ( | Q_DB * | db | ) |
Under-development.
| [Home] [About] [Examples] [Changes] [Download] [SVN Repository] [Install] [Reference] |