QDB provides methods for client applications to query a database and step
through the query results. The sample program shown here provides a walkthrough of the
sequence of QDB method calls necessary to connect to a QDB database, issue a query, read
the data in the result set, and disconnect from the database.
Your client application should perform these general steps:
- Connect to a database by calling qdb_connect().
- Query the database and examine the results:
- Execute an SQL statement on the
database by calling qdb_statement().
- Get the result set for the
statement by calling qdb_getresult().
- Read a data cell from the
result set by calling qdb_cell() and then use the data as needed.
- Free the result set by calling qdb_freeresult().
- Repeat these steps to
execute statements and use their results as many times as required.
- Close the database connection with qdb_disconnect().