8.1 Prerequisites and Background Information

This section describes the prerequisites that must be satisifed
before you work through the remaining tutorial sections, and shows
how to set up the framework code that serves as the basis for the
tutorial applications.

These tutorials refer to tables and sample data from the
world database, which you can download from the
“Example Databases” section of the
MySQL
Documentation page.

Each tutorial application uses a framework consisting of the
following code. The examples vary at the line that says
/* INSERT TUTORIAL CODE HERE! */ within the
try block, which is replaced for each
application with the application-specific code.

To try the framework code as a standalone program, use this
procedure:

Copy and paste the framework code to a file such as
framework.cpp. Edit the
#define statements to reflect your
connection parameters (server, user, password, database).
Also, because the file contains those parameters, set its
access mode to be readable only to yourself.

Compile the framework. For example, on OS X, the command might
look like this (enter the command on one line):