⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 statement_8h-source.html.svn-base

📁 絲路server源碼 Silk Road server source
💻 SVN-BASE
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>odbc++/statement.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body bgcolor="#ffffff"><!-- Generated by Doxygen 1.2.13.1 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </center><hr><h1>odbc++/statement.h</h1><div class="fragment"><pre>00001 <font class="comment">/* </font>00002 <font class="comment">   This file is part of libodbc++.</font>00003 <font class="comment">   </font>00004 <font class="comment">   Copyright (C) 1999-2000 Manush Dodunekov &lt;manush@stendahls.net&gt;</font>00005 <font class="comment">   </font>00006 <font class="comment">   This library is free software; you can redistribute it and/or</font>00007 <font class="comment">   modify it under the terms of the GNU Library General Public</font>00008 <font class="comment">   License as published by the Free Software Foundation; either</font>00009 <font class="comment">   version 2 of the License, or (at your option) any later version.</font>00010 <font class="comment">   </font>00011 <font class="comment">   This library is distributed in the hope that it will be useful,</font>00012 <font class="comment">   but WITHOUT ANY WARRANTY; without even the implied warranty of</font>00013 <font class="comment">   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</font>00014 <font class="comment">   Library General Public License for more details.</font>00015 <font class="comment">   </font>00016 <font class="comment">   You should have received a copy of the GNU Library General Public License</font>00017 <font class="comment">   along with this library; see the file COPYING.  If not, write to</font>00018 <font class="comment">   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,</font>00019 <font class="comment">   Boston, MA 02111-1307, USA.</font>00020 <font class="comment">*/</font>00021 00022 <font class="preprocessor">#ifndef __ODBCXX_STATEMENT_H</font>00023 <font class="preprocessor"></font><font class="preprocessor">#define __ODBCXX_STATEMENT_H</font>00024 <font class="preprocessor"></font>00025 <font class="preprocessor">#include &lt;odbc++/setup.h&gt;</font>00026 <font class="preprocessor">#include &lt;odbc++/types.h&gt;</font>00027 <font class="preprocessor">#include &lt;odbc++/errorhandler.h&gt;</font>00028 <font class="preprocessor">#include &lt;odbc++/connection.h&gt;</font>00029 00030 <font class="keyword">namespace </font>odbc {00031 00032   <font class="keyword">class </font>ResultSet;00033   <font class="keyword">class </font>DriverInfo;00034 <a name="l00036"></a><a class="code" href="classodbc_1_1_statement.html">00036</a>   <font class="keyword">class </font>ODBCXX_EXPORT Statement : <font class="keyword">public</font> ErrorHandler {00037     <font class="keyword">friend</font> <font class="keyword">class </font>Connection;00038     <font class="keyword">friend</font> <font class="keyword">class </font>ResultSet;00039     <font class="keyword">friend</font> <font class="keyword">class </font>DatabaseMetaData;00040 00041   <font class="keyword">protected</font>:00042     Connection* connection_;00043     SQLHSTMT hstmt_;00044     <font class="keywordtype">int</font> lastExecute_;00045 00046     <font class="keyword">const</font> DriverInfo* _getDriverInfo()<font class="keyword"> const </font>{00047       <font class="keywordflow">return</font> connection_-&gt;_getDriverInfo();00048     }00049 00050   <font class="keyword">private</font>:00051     ResultSet* currentResultSet_;00052 00053     <font class="keywordtype">int</font> fetchSize_;00054     <font class="keywordtype">int</font> resultSetType_;00055     <font class="keywordtype">int</font> resultSetConcurrency_;00056     00057     <font class="comment">//used internally</font>00058     <font class="keyword">enum</font> StatementState {00059       STATE_CLOSED,00060       STATE_OPEN00061     };00062 00063     StatementState state_;00064 00065     std::vector&lt;ODBCXX_STRING&gt; batches_;00066 00067     <font class="keywordtype">void</font> _registerResultSet(ResultSet* rs);00068     <font class="keywordtype">void</font> _unregisterResultSet(ResultSet* rs);00069 00070     <font class="keywordtype">void</font> _applyResultSetType();00071 00072     ResultSet* _getTypeInfo();00073     ResultSet* _getTables(<font class="keyword">const</font> ODBCXX_STRING&amp; catalog,00074                           <font class="keyword">const</font> ODBCXX_STRING&amp; schema,00075                           <font class="keyword">const</font> ODBCXX_STRING&amp; tableName,00076                           <font class="keyword">const</font> ODBCXX_STRING&amp; types);00077 00078     ResultSet* _getTablePrivileges(<font class="keyword">const</font> ODBCXX_STRING&amp; catalog,00079                                    <font class="keyword">const</font> ODBCXX_STRING&amp; schema,00080                                    <font class="keyword">const</font> ODBCXX_STRING&amp; tableName);00081 00082     ResultSet* _getColumnPrivileges(<font class="keyword">const</font> ODBCXX_STRING&amp; catalog,00083                                     <font class="keyword">const</font> ODBCXX_STRING&amp; schema,00084                                     <font class="keyword">const</font> ODBCXX_STRING&amp; tableName,00085                                     <font class="keyword">const</font> ODBCXX_STRING&amp; columnName);00086 00087     ResultSet* _getPrimaryKeys(<font class="keyword">const</font> ODBCXX_STRING&amp; catalog,00088                                <font class="keyword">const</font> ODBCXX_STRING&amp; schema,00089                                <font class="keyword">const</font> ODBCXX_STRING&amp; tableName);00090 00091     ResultSet* _getColumns(<font class="keyword">const</font> ODBCXX_STRING&amp; catalog,00092                            <font class="keyword">const</font> ODBCXX_STRING&amp; schema,00093                            <font class="keyword">const</font> ODBCXX_STRING&amp; tableName,00094                            <font class="keyword">const</font> ODBCXX_STRING&amp; columnName);00095 00096     ResultSet* _getIndexInfo(<font class="keyword">const</font> ODBCXX_STRING&amp; catalog,00097                              <font class="keyword">const</font> ODBCXX_STRING&amp; schema,00098                              <font class="keyword">const</font> ODBCXX_STRING&amp; tableName,00099                              <font class="keywordtype">bool</font> unique, <font class="keywordtype">bool</font> approximate);00100     00101     ResultSet* _getCrossReference(<font class="keyword">const</font> ODBCXX_STRING&amp; pc,00102                                   <font class="keyword">const</font> ODBCXX_STRING&amp; ps,00103                                   <font class="keyword">const</font> ODBCXX_STRING&amp; pt,00104                                   <font class="keyword">const</font> ODBCXX_STRING&amp; fc,00105                                   <font class="keyword">const</font> ODBCXX_STRING&amp; fs,00106                                   <font class="keyword">const</font> ODBCXX_STRING&amp; ft);00107 00108     00109     ResultSet* _getProcedures(<font class="keyword">const</font> ODBCXX_STRING&amp; catalog,00110                               <font class="keyword">const</font> ODBCXX_STRING&amp; schema,00111                               <font class="keyword">const</font> ODBCXX_STRING&amp; procName);00112     00113     ResultSet* _getProcedureColumns(<font class="keyword">const</font> ODBCXX_STRING&amp; catalog,00114                                     <font class="keyword">const</font> ODBCXX_STRING&amp; schema,00115                                     <font class="keyword">const</font> ODBCXX_STRING&amp; procName,00116                                     <font class="keyword">const</font> ODBCXX_STRING&amp; colName);00117 00118     ResultSet* _getSpecialColumns(<font class="keyword">const</font> ODBCXX_STRING&amp; catalog,00119                                   <font class="keyword">const</font> ODBCXX_STRING&amp; schema,00120                                   <font class="keyword">const</font> ODBCXX_STRING&amp; table,00121                                   <font class="keywordtype">int</font> what,<font class="keywordtype">int</font> scope,<font class="keywordtype">int</font> nullable);00122       00123   <font class="keyword">protected</font>:00124     Statement(Connection* con, SQLHSTMT hstmt, 00125               <font class="keywordtype">int</font> resultSetType, <font class="keywordtype">int</font> resultSetConcurrency);00126     00127     <font class="comment">//utilities</font>00128     SQLUINTEGER _getNumericOption(SQLINTEGER optnum);00129     ODBCXX_STRING _getStringOption(SQLINTEGER optnum);00130     00131     <font class="keywordtype">void</font> _setNumericOption(SQLINTEGER optnum, SQLUINTEGER value);00132     <font class="keywordtype">void</font> _setStringOption(SQLINTEGER optnum, <font class="keyword">const</font> ODBCXX_STRING&amp; value);00133 00134 <font class="preprocessor">#if ODBCVER &gt;= 0x0300</font>00135 <font class="preprocessor"></font>    SQLPOINTER _getPointerOption(SQLINTEGER optnum);00136     <font class="keywordtype">void</font> _setPointerOption(SQLINTEGER optnum, SQLPOINTER value);00137 <font class="preprocessor">#endif</font>00138 <font class="preprocessor"></font>00139     <font class="comment">//this returns true if we have a result set pending</font>00140     <font class="keywordtype">bool</font> _checkForResults();00141 00142     <font class="comment">//this _always_ returns a ResultSet. If hideMe is true, this statement</font>00143     <font class="comment">//becomes 'owned' by the ResultSet</font>00144     ResultSet* _getResultSet(<font class="keywordtype">bool</font> hideMe =<font class="keyword">false</font>);00145 00146     <font class="comment">//this is called before a Statement (or any of the derived classes)</font>00147     <font class="comment">//is executed</font>00148     <font class="keywordtype">void</font> _beforeExecute();00149 00150     <font class="comment">//this is called after a successeful execution</font>00151     <font class="keywordtype">void</font> _afterExecute();00152     00153 00154   <font class="keyword">public</font>:00158     <font class="keyword">virtual</font> ~Statement();00159 00161     Connection* getConnection();00162     00163 00165     <font class="keywordtype">void</font> cancel();00166 00174     <font class="keyword">virtual</font> <font class="keywordtype">bool</font> execute(<font class="keyword">const</font> ODBCXX_STRING&amp; sql);00175     00180     <font class="keyword">virtual</font> ResultSet* executeQuery(<font class="keyword">const</font> ODBCXX_STRING&amp; sql);00181 00185     <font class="keyword">virtual</font> <font class="keywordtype">int</font> executeUpdate(<font class="keyword">const</font> ODBCXX_STRING&amp; sql);00186     00192     <font class="keywordtype">int</font> getUpdateCount();00193     00195     ResultSet* getResultSet();00196 00201     <font class="keywordtype">bool</font> getMoreResults();00202 00204     <font class="keywordtype">void</font> setCursorName(<font class="keyword">const</font> ODBCXX_STRING&amp; name);00205     <a name="l00209"></a><a class="code" href="classodbc_1_1_statement.html#a10">00209</a>     <font class="keywordtype">int</font> getFetchSize() {00210       <font class="keywordflow">return</font> fetchSize_;00211     }00212 00214     <font class="keywordtype">void</font> setFetchSize(<font class="keywordtype">int</font> size);00215 <a name="l00217"></a><a class="code" href="classodbc_1_1_statement.html#a12">00217</a>     <font class="keywordtype">int</font> getResultSetConcurrency() {00218       <font class="keywordflow">return</font> resultSetConcurrency_;00219     }00220 <a name="l00222"></a><a class="code" href="classodbc_1_1_statement.html#a13">00222</a>     <font class="keywordtype">int</font> getResultSetType() {00223       <font class="keywordflow">return</font> resultSetType_;00224     }00225     00227     <font class="keywordtype">int</font> getQueryTimeout();00229     <font class="keywordtype">void</font> setQueryTimeout(<font class="keywordtype">int</font> seconds);00230 00232     <font class="keywordtype">int</font> getMaxRows();00234     <font class="keywordtype">void</font> setMaxRows(<font class="keywordtype">int</font> maxRows);00235 00237     <font class="keywordtype">int</font> getMaxFieldSize();00239     <font class="keywordtype">void</font> setMaxFieldSize(<font class="keywordtype">int</font> maxFieldSize);00240 00246     <font class="keywordtype">void</font> setEscapeProcessing(<font class="keywordtype">bool</font> on);00247 00252     <font class="keywordtype">bool</font> getEscapeProcessing();00253 00257     <font class="keywordtype">void</font> close();00258 00259   };00260   00261 00262 00263 } <font class="comment">// namespace odbc</font>00264 00265 00266 <font class="preprocessor">#endif // __ODBCXX_STATEMENT_H</font></pre></div><hr><div align=center><a class=footer href="http://orcane.net/freeodbc++/">Go back to the freeodbc++ homepage</a></div>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -