QDB provides methods that client applications can call to query a database and step through the query results.
The detailed sample program shown here provides a walkthrough of the sequence of QDB method calls necessary to connect to,
query, and disconnect from a QDB database.
Your QDB client application should perform these general steps:
- Connect to a database by calling qdb_connect()
- Query the database:
- Execute a statement on the database by calling qdb_statement().
- Get the results of the statement (if any) by calling qdb_getresult().
- Use the results by calling qdb_cell().
- Free the result by calling qdb_freeresult().
- Repeat the preceding steps to execute statements and use the results, as required.
- Close the database connection with qdb_disconnect()