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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>MySQL++ Reference Manual</title>
<meta http-equiv="Content-type" content="text/html;charset=iso-8859-1">
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="refman.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li id="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul></div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul></div>
<div class="nav">
<b>mysqlpp</b>::<a class="el" href="classmysqlpp_1_1BadQuery.html">BadQuery</a></div>
<h1>mysqlpp::BadQuery Class Reference</h1><!-- doxytag: class="mysqlpp::BadQuery" --><!-- doxytag: inherits="mysqlpp::Exception" --><a class="el" href="classmysqlpp_1_1Exception.html">Exception</a> thrown when the database server encounters a problem while processing your query.
<a href="#_details">More...</a>
<p>
<code>#include <<a class="el" href="exceptions_8h-source.html">exceptions.h</a>></code>
<p>
Inheritance diagram for mysqlpp::BadQuery:<p><center><img src="classmysqlpp_1_1BadQuery__inherit__graph.png" border="0" usemap="#mysqlpp_1_1BadQuery__inherit__map" alt="Inheritance graph"></center>
<map name="mysqlpp_1_1BadQuery__inherit__map">
<area href="classmysqlpp_1_1Exception.html" shape="rect" coords="6,7,158,31" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for mysqlpp::BadQuery:<p><center><img src="classmysqlpp_1_1BadQuery__coll__graph.png" border="0" usemap="#mysqlpp_1_1BadQuery__coll__map" alt="Collaboration graph"></center>
<map name="mysqlpp_1_1BadQuery__coll__map">
<area href="classmysqlpp_1_1Exception.html" shape="rect" coords="6,97,158,121" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classmysqlpp_1_1BadQuery-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1BadQuery.html#49600596b86773d8a13f0cd15a02118a">BadQuery</a> (const char *w="", int e=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create exception object. <a href="#49600596b86773d8a13f0cd15a02118a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1BadQuery.html#35999dcc51a6cd76a03bd4a1d565d888">BadQuery</a> (const std::string &w, int e=0)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create exception object. <a href="#35999dcc51a6cd76a03bd4a1d565d888"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1BadQuery.html#a59e11113935fad141f156e6d61bb85e">errnum</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the error number corresponding to the error message returned by <a class="el" href="classmysqlpp_1_1Exception.html#970fe1876f16ea720382dff87f80cf17">what()</a>. <a href="#a59e11113935fad141f156e6d61bb85e"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<a class="el" href="classmysqlpp_1_1Exception.html">Exception</a> thrown when the database server encounters a problem while processing your query.
<p>
Unlike most other MySQL++ exceptions, which carry just an error message, this type carries an error number to preserve <a class="el" href="classmysqlpp_1_1Connection.html#3cb1bf601b19dbb87b36bed4590f4214">Connection::errnum()</a>'s return value at the point the exception is thrown. We do this because when using the <a class="el" href="classmysqlpp_1_1Transaction.html">Transaction</a> class, the rollback process that occurs during stack unwinding issues a query to the database server, overwriting the error value. This rollback should always succeed, so this effect can fool code that relies on <a class="el" href="classmysqlpp_1_1Connection.html#3cb1bf601b19dbb87b36bed4590f4214">Connection::errnum()</a> into believing that there was no error.<p>
Beware that in older versions of MySQL++, this was effectively the generic exception type. (This is most especially true in v1.7.x, but it continued to a lesser extent through the v2.x series.) When converting old code to new versions of MySQL++, it's therefore possible to get seemingly "new" exceptions thrown, which could crash your program if you don't also catch a more generic type like <a class="el" href="classmysqlpp_1_1Exception.html">mysqlpp::Exception</a> or std::exception.
<p>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="49600596b86773d8a13f0cd15a02118a"></a><!-- doxytag: member="mysqlpp::BadQuery::BadQuery" ref="49600596b86773d8a13f0cd15a02118a" args="(const char *w="", int e=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">mysqlpp::BadQuery::BadQuery </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>w</em> = <code>""</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>e</em> = <code>0</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"><code> [inline, explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Create exception object.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>w</em> </td><td>explanation for why the exception was thrown </td></tr>
<tr><td valign="top"></td><td valign="top"><em>e</em> </td><td>the error number from the underlying database API </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="35999dcc51a6cd76a03bd4a1d565d888"></a><!-- doxytag: member="mysqlpp::BadQuery::BadQuery" ref="35999dcc51a6cd76a03bd4a1d565d888" args="(const std::string &w, int e=0)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">mysqlpp::BadQuery::BadQuery </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>w</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>e</em> = <code>0</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"><code> [inline, explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Create exception object.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>w</em> </td><td>explanation for why the exception was thrown </td></tr>
<tr><td valign="top"></td><td valign="top"><em>e</em> </td><td>the error number from the underlying database API </td></tr>
</table>
</dl>
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a59e11113935fad141f156e6d61bb85e"></a><!-- doxytag: member="mysqlpp::BadQuery::errnum" ref="a59e11113935fad141f156e6d61bb85e" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int mysqlpp::BadQuery::errnum </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Return the error number corresponding to the error message returned by <a class="el" href="classmysqlpp_1_1Exception.html#970fe1876f16ea720382dff87f80cf17">what()</a>.
<p>
This may return the same value as <a class="el" href="classmysqlpp_1_1Connection.html#3cb1bf601b19dbb87b36bed4590f4214">Connection::errnum()</a>, but not always. See the overview documentation for this class for the reason for the difference.
</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="exceptions_8h-source.html">exceptions.h</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Wed Feb 4 14:43:07 2009 for MySQL++ by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>
|