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 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Simple&nbsp;C++&nbsp;ODBC&nbsp;Database&nbsp;API: SimpleDB::Query Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.2 -->
<div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="pages.html">Related Pages</a> | <a class="qindex" href="examples.html">Examples</a></div>
<div class="nav">
<a class="el" href="namespaceSimpleDB.html">SimpleDB</a>::<a class="el" href="classSimpleDB_1_1Query.html">Query</a></div>
<h1>SimpleDB::Query Class Reference</h1>Class to represent a database query.
<a href="#_details">More...</a>
<p>
<code>#include <<a class="el" href="Query_8h-source.html">Query.h</a>></code>
<p>
<a href="classSimpleDB_1_1Query-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="classSimpleDB_1_1Query.html#a0">Query</a> (SQLHDBC <a class="el" href="classSimpleDB_1_1Query.html#p1">connectionHandle</a>)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor called by the <a class="el" href="classSimpleDB_1_1Database.html">Database</a> object. <a href="#a0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a1" doxytag="SimpleDB::Query::~Query"></a>
</td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleDB_1_1Query.html#a1">~Query</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor deallocates any memory or resources. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleDB_1_1Query.html#a2">bind</a> (<a class="el" href="classSimpleDB_1_1Column.html">Column</a> *columns[], int numberColumns)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Bind the given columns to this query context. <a href="#a2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleDB_1_1Query.html#a3">execute</a> (const std::string &sqlQuery)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Execute the given query. <a href="#a3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleDB_1_1Query.html#a4">fetchRow</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Fetches a row of data returned by the SQL query. <a href="#a4"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="p0" doxytag="SimpleDB::Query::statementHandle"></a>
SQLHSTMT </td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleDB_1_1Query.html#p0">statementHandle</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">ODBC statement handle. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="p1" doxytag="SimpleDB::Query::connectionHandle"></a>
SQLHDBC </td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleDB_1_1Query.html#p1">connectionHandle</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">ODBC connection handle. <br></td></tr>
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleDB_1_1Query_1_1Exception.html">Exception</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classSimpleDB_1_1Query.html">Query</a> exception class. <a href="classSimpleDB_1_1Query_1_1Exception.html#_details">More...</a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Class to represent a database query.
<p>
This class is created by the <a class="el" href="classSimpleDB_1_1Database.html">Database</a> object. It encapsulates details pertaining to a database query. <dl compact><dt><b>Examples: </b></dt><dd>
<p>
<a class="el" href="complete_8cpp-example.html#_a4">complete.cpp</a>, <a class="el" href="factory_8cpp-example.html#_a14">factory.cpp</a>, and <a class="el" href="simple_8cpp-example.html#_a23">simple.cpp</a>.</dl>
<p>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="a0" doxytag="SimpleDB::Query::Query"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">SimpleDB::Query::Query </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">SQLHDBC </td>
<td class="mdname1" valign="top" nowrap> <em>connectionHandle</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Constructor called by the <a class="el" href="classSimpleDB_1_1Database.html">Database</a> 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>connectionHandle</em> </td><td>The connection handle from a database object. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a2" doxytag="SimpleDB::Query::bind"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void SimpleDB::Query::bind </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classSimpleDB_1_1Column.html">Column</a> * </td>
<td class="mdname" nowrap> <em>columns</em>[], </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>numberColumns</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Bind the given columns to this query context.
<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>columns</em> </td><td>An array of columns to bind to this query. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>numberColumns</em> </td><td>The number of columns in the array. </td></tr>
</table>
</dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="complete_8cpp-example.html#a6">complete.cpp</a>, <a class="el" href="factory_8cpp-example.html#a17">factory.cpp</a>, and <a class="el" href="simple_8cpp-example.html#a27">simple.cpp</a>.</dl> </td>
</tr>
</table>
<a class="anchor" name="a3" doxytag="SimpleDB::Query::execute"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void SimpleDB::Query::execute </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const std::string & </td>
<td class="mdname1" valign="top" nowrap> <em>sqlQuery</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Execute the given query.
<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>sqlQuery</em> </td><td>The SQL query. </td></tr>
</table>
</dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em><a class="el" href="classSimpleDB_1_1Database_1_1NoDataException.html">Database::NoDataException</a></em> </td><td>if the return from the SQL query is SQL_NO_DATA </td></tr>
<tr><td valign="top"></td><td valign="top"><em><a class="el" href="classSimpleDB_1_1Query_1_1Exception.html">Exception</a></em> </td><td>When there is a problem with the database or with the query itself. </td></tr>
</table>
</dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="complete_8cpp-example.html#a7">complete.cpp</a>, <a class="el" href="factory_8cpp-example.html#a18">factory.cpp</a>, and <a class="el" href="simple_8cpp-example.html#a28">simple.cpp</a>.</dl> </td>
</tr>
</table>
<a class="anchor" name="a4" doxytag="SimpleDB::Query::fetchRow"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">bool SimpleDB::Query::fetchRow </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Fetches a row of data returned by the SQL query.
<p>
<dl compact><dt><b>Returns:</b></dt><dd>Returns false if there is no data to be returned. </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="complete_8cpp-example.html#a8">complete.cpp</a>, <a class="el" href="factory_8cpp-example.html#a19">factory.cpp</a>, and <a class="el" href="simple_8cpp-example.html#a29">simple.cpp</a>.</dl> </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Query_8h-source.html">Query.h</a></ul>
<hr>
<div align="right"><small>
Copyright (C) 2005 <a target="top" href="http://www.eminence.com.au">Eminence Technology Pty Ltd</a>.<br>
Documentation pages generated by doxygen.</small><br>
<a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=129109&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a>
</div>
|