--- a/examples/standalone_example_docs1.cpp 2012-08-16 12:15:30.000000000 -0700
+++ b/examples/standalone_example_docs1.cpp 2012-08-23 10:05:54.000000000 -0700
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "mysql_connection.h"
+/* Public interface of the MySQL Connector/C++ */
+#include <driver/mysql_public_iface.h>
+/* Connection parameter and sample data */
#include <cppconn/driver.h>
#include <cppconn/exception.h>
#include <cppconn/resultset.h>
+int main(int argc, const char **argv)
-cout << "Running 'SELECT 'Hello World!' AS _message'..." << endl;
- /* Create a connection */
- driver = sql::mysql::get_driver_instance();
- con = driver->connect("tcp://127.0.0.1:3306", "root", "root");
- /* Connect to the MySQL test database */
- con->setSchema("test");
- stmt = con->createStatement();
- res = stmt->executeQuery("SELECT 'Hello World!' AS _message");
- cout << "\t... MySQL replies: ";
- /* Access column data by alias or column name */
- cout << res->getString("_message") << endl;
- cout << "\t... MySQL says it again: ";
- /* Access column fata by numeric offset, 1 is the first column */
- cout << res->getString(1) << endl;
-} catch (sql::SQLException &e) {
- cout << "# ERR: SQLException in " << __FILE__;
- cout << "(" << EXAMPLE_FUNCTION << ") on line " << __LINE__ << endl;
- cout << "# ERR: " << e.what();