1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>MySQL++ v3.2.5 User Manual</title><link rel="stylesheet" type="text/css" href="tangentsoft.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="MySQL++ v3.2.5 User Manual"><link rel="next" href="overview.html" title="2.Overview"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">MySQL++ v3.2.5 User Manual</th></tr><tr><td width="20%" align="left"></td><th width="60%" align="center"></th><td width="20%" align="right"><a accesskey="n" href="overview.html">Next</a></td></tr></table><hr></div><div class="article"><div class="titlepage"><div><div><h2 class="title"><a name="idp140589773185448"></a>MySQL++ v3.2.5 User Manual</h2></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Kevin</span> <span class="surname">Atkinson</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Sinisa</span> <span class="surname">Milivojevic</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Monty</span> <span class="surname">Widenius</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Warren</span> <span class="surname">Young</span></h3></div></div></div><div><p class="copyright">Copyright 1998-2001, 2005-2019 Kevin Atkinson (original author), MySQL AB, Educational Technology Resources</p></div><div><p class="pubdate">July21,2019</p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="index.html#intro">1. Introduction</a></span></dt><dd><dl><dt><span class="sect2"><a href="index.html#history">1.1. A Brief History of MySQL++</a></span></dt><dt><span class="sect2"><a href="index.html#asking-questions">1.2. If You Have Questions...</a></span></dt></dl></dd><dt><span class="sect1"><a href="overview.html">2. Overview</a></span></dt><dd><dl><dt><span class="sect2"><a href="overview.html#Connection">2.1. The Connection Object</a></span></dt><dt><span class="sect2"><a href="overview.html#Query">2.2. The Query Object</a></span></dt><dt><span class="sect2"><a href="overview.html#Result">2.3. Result Sets</a></span></dt><dt><span class="sect2"><a href="overview.html#exceptions-intro">2.4. Exceptions</a></span></dt></dl></dd><dt><span class="sect1"><a href="tutorial.html">3. Tutorial</a></span></dt><dd><dl><dt><span class="sect2"><a href="tutorial.html#examples">3.1. Running the Examples</a></span></dt><dt><span class="sect2"><a href="tutorial.html#simple">3.2. A Simple Example</a></span></dt><dt><span class="sect2"><a href="tutorial.html#simple2">3.3. A More Complicated Example</a></span></dt><dt><span class="sect2"><a href="tutorial.html#exceptions">3.4. Exceptions</a></span></dt><dt><span class="sect2"><a href="tutorial.html#qescape">3.5. Quoting and Escaping</a></span></dt><dt><span class="sect2"><a href="tutorial.html#sql-types">3.6. C++ vs. SQL Data Types</a></span></dt><dt><span class="sect2"><a href="tutorial.html#sql-null">3.7. Handling SQL Nulls</a></span></dt><dt><span class="sect2"><a href="tutorial.html#string-types">3.8. MySQL++’s Special String Types</a></span></dt><dt><span class="sect2"><a href="tutorial.html#blob">3.9. Dealing with Binary Data</a></span></dt><dt><span class="sect2"><a href="tutorial.html#Transaction">3.10. Using Transactions</a></span></dt><dt><span class="sect2"><a href="tutorial.html#querytypes">3.11. Which Query Type to Use?</a></span></dt><dt><span class="sect2"><a href="tutorial.html#store_if">3.12. Conditional Result Row Handling</a></span></dt><dt><span class="sect2"><a href="tutorial.html#for_each">3.13. Executing Code for Each Row In a Result Set</a></span></dt><dt><span class="sect2"><a href="tutorial.html#connopts">3.14. Connection Options</a></span></dt><dt><span class="sect2"><a href="tutorial.html#conn-timeout">3.15. Dealing with Connection Timeouts</a></span></dt><dt><span class="sect2"><a href="tutorial.html#concurrentqueries">3.16. Concurrent Queries on a Connection</a></span></dt><dt><span class="sect2"><a href="tutorial.html#fieldinf">3.17. Getting Field Meta-Information</a></span></dt></dl></dd><dt><span class="sect1"><a href="tquery.html">4. Template Queries</a></span></dt><dd><dl><dt><span class="sect2"><a href="tquery.html#tquery-setup">4.1. Setting up Template Queries</a></span></dt><dt><span class="sect2"><a href="tquery.html#tquery-parms">4.2. Setting the Parameters at Execution Time</a></span></dt><dt><span class="sect2"><a href="tquery.html#tquery-defaults">4.3. Default Parameters</a></span></dt><dt><span class="sect2"><a href="tquery.html#tquery-errors">4.4. Error Handling</a></span></dt></dl></dd><dt><span class="sect1"><a href="ssqls.html">5. Specialized SQL Structures</a></span></dt><dd><dl><dt><span class="sect2"><a href="ssqls.html#sql_create">5.1. sql_create</a></span></dt><dt><span class="sect2"><a href="ssqls.html#ssqls-compare-init">5.2. SSQLS Comparison and Initialization</a></span></dt><dt><span class="sect2"><a href="ssqls.html#ssqls-retrieving">5.3. Retrieving data</a></span></dt><dt><span class="sect2"><a href="ssqls.html#ssqls-adding">5.4. Adding data</a></span></dt><dt><span class="sect2"><a href="ssqls.html#ssqls-modifying">5.5. Modifying data</a></span></dt><dt><span class="sect2"><a href="ssqls.html#ssqls-comparing">5.6. Storing SSQLSes in Associative Containers</a></span></dt><dt><span class="sect2"><a href="ssqls.html#ssqls-table-name">5.7. Changing the Table Name</a></span></dt><dt><span class="sect2"><a href="ssqls.html#ssqls-in-header">5.8. Using an SSQLS in Multiple Modules</a></span></dt><dt><span class="sect2"><a href="ssqls.html#ssqls-internals">5.9. Harnessing SSQLS Internals</a></span></dt><dt><span class="sect2"><a href="ssqls.html#ssqls-field-names">5.10. Having Different Field Names in C++ and SQL</a></span></dt><dt><span class="sect2"><a href="ssqls.html#ssqls-pretty">5.11. Expanding SSQLS Macros</a></span></dt><dt><span class="sect2"><a href="ssqls.html#ssqls-customization">5.12. Customizing the SSQLS Mechanism</a></span></dt><dt><span class="sect2"><a href="ssqls.html#ssqls-derivation">5.13. Deriving from an SSQLS</a></span></dt><dt><span class="sect2"><a href="ssqls.html#ssqls-blob">5.14. SSQLS and BLOB Columns</a></span></dt><dt><span class="sect2"><a href="ssqls.html#ssqls-vc2003">5.15. SSQLS and Visual C++ 2003</a></span></dt></dl></dd><dt><span class="sect1"><a href="unicode.html">6. Using Unicode with MySQL++</a></span></dt><dd><dl><dt><span class="sect2"><a href="unicode.html#unicode-history">6.1. A Short History of Unicode</a></span></dt><dt><span class="sect2"><a href="unicode.html#unicode-mysql">6.2. Unicode in MySQL</a></span></dt><dt><span class="sect2"><a href="unicode.html#unicode-unix">6.3. Unicode on Unixy Systems</a></span></dt><dt><span class="sect2"><a href="unicode.html#unicode-windows">6.4. Unicode on Windows</a></span></dt><dt><span class="sect2"><a href="unicode.html#unicode-refs">6.5. For More Information</a></span></dt></dl></dd><dt><span class="sect1"><a href="threads.html">7. Using MySQL++ in a Multithreaded Program</a></span></dt><dd><dl><dt><span class="sect2"><a href="threads.html#thread-build">7.1. Build Issues</a></span></dt><dt><span class="sect2"><a href="threads.html#thread-conn-mgmt">7.2. Connection Management</a></span></dt><dt><span class="sect2"><a href="threads.html#thread-helpers">7.3. Helper Functions</a></span></dt><dt><span class="sect2"><a href="threads.html#thread-data-sharing">7.4. Sharing MySQL++ Data Structures</a></span></dt></dl></dd><dt><span class="sect1"><a href="configuration.html">8. Configuring MySQL++</a></span></dt><dd><dl><dt><span class="sect2"><a href="configuration.html#mysql-loc">8.1. The Location of the MySQL Development Files</a></span></dt><dt><span class="sect2"><a href="configuration.html#max-fields">8.2. The Maximum Number of Fields Allowed</a></span></dt><dt><span class="sect2"><a href="configuration.html#buried-headers">8.3. Buried MySQL C API Headers</a></span></dt><dt><span class="sect2"><a href="configuration.html#c99">8.4. Building MySQL++ on Systems Without Complete C99
Support</a></span></dt></dl></dd><dt><span class="sect1"><a href="incorporating.html">9. Using MySQL++ in Your Own Project</a></span></dt><dd><dl><dt><span class="sect2"><a href="incorporating.html#inc-vstudio">9.1. Visual C++</a></span></dt><dt><span class="sect2"><a href="incorporating.html#inc-unix">9.2. Unixy Platforms: Linux, *BSD, OS X, Cygwin, Solaris...</a></span></dt><dt><span class="sect2"><a href="incorporating.html#inc-osx">9.3. OS X</a></span></dt><dt><span class="sect2"><a href="incorporating.html#inc-mingw">9.4. MinGW</a></span></dt><dt><span class="sect2"><a href="incorporating.html#inc-eclipse">9.5. Eclipse</a></span></dt></dl></dd><dt><span class="sect1"><a href="breakages.html">10. Incompatible Library Changes</a></span></dt><dd><dl><dt><span class="sect2"><a href="breakages.html#api-changes">10.1. API Changes</a></span></dt><dt><span class="sect2"><a href="breakages.html#abi-changes">10.2. ABI Changes</a></span></dt></dl></dd><dt><span class="sect1"><a href="licenses.html">11. Licensing</a></span></dt><dd><dl><dt><span class="sect2"><a href="licenses.html#lgpl">11.1. GNU Lesser General Public License</a></span></dt><dt><span class="sect2"><a href="licenses.html#userman-license">11.2. MySQL++ User Manual License</a></span></dt></dl></dd></dl></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="intro"></a>1.Introduction</h2></div></div></div><p>MySQL++ is a powerful C++ wrapper for MySQL’s
C API<a href="#ftn.idp140589485558488" class="footnote" name="idp140589485558488"><sup class="footnote">[1]</sup></a>.
Its purpose is to make working with queries as easy as working with
STL containers.</p><p>The latest version of MySQL++ can be found at <a class="ulink" href="http://tangentsoft.net/mysql++/" target="_top">the official web
site</a>.</p><p>Support for MySQL++ can be had on <a class="ulink" href="http://lists.mysql.com/plusplus" target="_top">the mailing list</a>. That
page hosts the mailing list archives, and tells you how you can
subscribe.</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="history"></a>1.1.A Brief History of MySQL++</h3></div></div></div><p>MySQL++ was created in 1998 by Kevin Atkinson. It started
out MySQL-specific, but there were early efforts to try and
make it database-independent, and call it SQL++. This is where
the old library name “sqlplus” came from. This
is also why the old versions prefixed some class names with
“Mysql” but not others: the others were supposed to
be the database-independent parts. All of Kevin’s releases
had pre-1.0 version numbers.</p><p>Then in 1999, <a class="ulink" href="http://www.mysql.com/" target="_top">MySQL
AB</a> took over development of the library. In the beginning,
<a class="ulink" href="http://en.wikipedia.org/wiki/Monty_Widenius" target="_top">Monty
Widenius</a> himself did some of the work, but later gave it
over to another MySQL employee, Sinisa Milivojevic. MySQL released
versions 1.0 and 1.1, and then Kevin gave over maintenance to
Sinisa officially with 1.2, and ceased to have any involvement
with the library’s maintenance. Sinisa went on to maintain
the library through 1.7.9, released in mid-2001. It seems to be
during this time that the dream of multiple-database compatibility
died, for obvious reasons.</p><p>With version 1.7.9, MySQL++ went into a period of
stasis, lasting over three years. (Perhaps it was the
ennui and retrenchment following the collapse of <a class="ulink" href="http://en.wikipedia.org/wiki/Dot-com_bubble" target="_top">the
bubble</a> that caused them to lose interest.) During this
time, Sinisa ran the MySQL++ mailing list and supported its users,
but made no new releases. Contributed patches were either ignored
or put up on the MySQL++ web site for users to try, without any
official blessing.</p><p>The biggest barrier to using MySQL++ during this period
is that the popular C++ compilers of 2001 weren’t all
that compatible with the C++ Standard. As a result, MySQL++
used many nonstandard constructs, to allow for compatibility
with older compilers. Each new compiler released in the
following years increased compliance, either warning
about or rejecting code using pre-Standard constructs.
In particular, <a class="ulink" href="http://gcc.gnu.org/" target="_top">GCC</a>
was emerging from the mess following the <a class="ulink" href="http://en.wikipedia.org/wiki/GNU_Compiler_Collection#EGCS" target="_top">EGCS
fork</a> during this time. The fork was healed officially
in 1999, but there’s always a delay of a few years between
the release of a new GCC and widespread adoption. The post-EGCS
versions of GCC were only beginning to become popular by 2001,
when development on MySQL++ halted. As a result, it became
increasingly difficult to get MySQL++ to build cleanly as newer
compilers came out. Since MySQL++ uses templates heavily, this
affected end user programs as well: MySQL++ code got included
directly in your program, so any warnings or errors it caused
became your program’s problem.</p><p>As a result, most of the patches contributed to the MySQL++
project during this period were to fix up standards compliance
issues. Because no one was bothering to officially test and bless
these patches, you ended up with the worst aspects of a <a class="ulink" href="http://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar" target="_top">bazaar</a>
development model: complete freedom of development, but no guiding
hand to select from the good stuff and reject the rest. Many of the
patches were mutually incompatible. Some would build upon other
patches, so you had to apply them in the proper sequence. Others
did useful things, but didn’t give a fully functional copy of
MySQL++. Figuring out which patch(es) to use was an increasingly
frustrating exercise as the years wore on, and newer GCCs became
popular.</p><p>In early August of 2004, Warren Young got fed up with this
situation and took over. He released 1.7.10 later that month,
which did little more than make the code build with GCC 3.3 without
warnings. Since then, with a little help from his friends on the
Net, MySQL++ has lost a lot of bugs, gained a lot of features,
gained a few more bugs, lost them again... MySQL++ is alive and
healthy now.</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="asking-questions"></a>1.2.If You Have Questions...</h3></div></div></div><p>If you want to email someone to ask questions about
this library, we greatly prefer that you send mail to the
<a class="ulink" href="http://lists.mysql.com/plusplus" target="_top">MySQL++ mailing
list</a>. The mailing list is archived, so if you have
questions, do a search to see if the question has been asked
before.</p><p>You may find people’s individual email addresses in various
files within the MySQL++ distribution. Please do not send mail
to them unless you are sending something that is inherently
personal. Not all of the principal developers of MySQL++ are still
active in its development; those who have dropped out have no wish
to be bugged about MySQL++. Those of us still active in MySQL++
development monitor the mailing list, so you aren’t getting any
extra “coverage” by sending messages to additional
email addresses.</p></div></div><div class="footnotes"><br><hr style="width:100; text-align:left;margin-left: 0"><div id="ftn.idp140589485558488" class="footnote"><p><a href="#idp140589485558488" class="para"><sup class="para">[1] </sup></a>The MySQL C API is also known as <a class="ulink" href="https://dev.mysql.com/downloads/connector/c/" target="_top">Connector/C</a>.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"></td><td width="20%" align="center"></td><td width="40%" align="right"><a accesskey="n" href="overview.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"></td><td width="20%" align="center"></td><td width="40%" align="right" valign="top">2.Overview</td></tr></table></div></body></html>
|