📄 errorhandler_8h-source.html.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++/errorhandler.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> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> </center><hr><h1>odbc++/errorhandler.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 <manush@stendahls.net></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_ERRORHANDLER_H</font>00023 <font class="preprocessor"></font><font class="preprocessor">#define __ODBCXX_ERRORHANDLER_H</font>00024 <font class="preprocessor"></font>00025 <font class="preprocessor">#include <odbc++/setup.h></font>00026 <font class="preprocessor">#include <odbc++/types.h></font>00027 <font class="preprocessor">#include <odbc++/threads.h></font>00028 00029 <font class="keyword">namespace </font>odbc {00030 <a name="l00032"></a><a class="code" href="classodbc_1_1_error_handler.html">00032</a> <font class="keyword">class </font>ODBCXX_EXPORT ErrorHandler {00033 <font class="keyword">friend</font> <font class="keyword">class </font>DriverManager;00034 <font class="keyword">friend</font> <font class="keyword">class </font>DataStreamBuf;00035 <font class="keyword">friend</font> <font class="keyword">class </font>DataStream;00036 <font class="keyword">private</font>:00037 <font class="comment">// private data</font>00038 <font class="keyword">struct </font>PD;00039 PD* pd_;00040 00041 WarningList* warnings_;00042 <font class="keywordtype">bool</font> collectWarnings_;00043 00044 <font class="comment">//the maxumum number of warnings to contain at a time</font>00045 <font class="keyword">enum</font> {00046 MAX_WARNINGS=12800047 };00048 00049 <font class="keyword">protected</font>:00050 <font class="keywordtype">void</font> _postWarning(SQLWarning* w);00051 00052 00053 <font class="preprocessor">#if ODBCVER < 0x0300</font>00054 <font class="preprocessor"></font> <font class="keywordtype">void</font> _checkErrorODBC2(SQLHENV henv,00055 SQLHDBC hdbc,00056 SQLHSTMT hstmt,00057 SQLRETURN r,00058 <font class="keyword">const</font> ODBCXX_STRING& what);00059 <font class="preprocessor">#else</font>00060 <font class="preprocessor"></font>00061 <font class="keywordtype">void</font> _checkErrorODBC3(SQLINTEGER handleType,00062 SQLHANDLE h,00063 SQLRETURN r, <font class="keyword">const</font> ODBCXX_STRING& what);00064 <font class="preprocessor">#endif //ODBCVER < 0x0300</font>00065 <font class="preprocessor"></font>00066 <font class="keywordtype">void</font> _checkStmtError(SQLHSTMT hstmt,00067 SQLRETURN r, <font class="keyword">const</font> ODBCXX_CHAR_TYPE* what=ODBCXX_STRING_CONST(<font class="stringliteral">""</font>)) {00068 00069 <font class="keywordflow">if</font>(r==SQL_SUCCESS_WITH_INFO || r==SQL_ERROR) {00070 <font class="preprocessor">#if ODBCVER < 0x0300</font>00071 <font class="preprocessor"></font>00072 this->_checkErrorODBC2(SQL_NULL_HENV, SQL_NULL_HDBC, hstmt,00073 r,ODBCXX_STRING_C(what));00074 <font class="preprocessor">#else</font>00075 <font class="preprocessor"></font> 00076 this->_checkErrorODBC3(SQL_HANDLE_STMT,hstmt,r,ODBCXX_STRING_C(what));00077 00078 <font class="preprocessor">#endif</font>00079 <font class="preprocessor"></font> }00080 }00081 00082 <font class="keywordtype">void</font> _checkConError(SQLHDBC hdbc,00083 SQLRETURN r,00084 <font class="keyword">const</font> ODBCXX_CHAR_TYPE* what=ODBCXX_STRING_CONST(<font class="stringliteral">""</font>)) {00085 <font class="keywordflow">if</font>(r==SQL_SUCCESS_WITH_INFO || r==SQL_ERROR) {00086 <font class="preprocessor">#if ODBCVER < 0x0300</font>00087 <font class="preprocessor"></font> 00088 this->_checkErrorODBC2(SQL_NULL_HENV, hdbc, SQL_NULL_HSTMT, r,00089 ODBCXX_STRING_C(what));00090 00091 <font class="preprocessor">#else</font>00092 <font class="preprocessor"></font> 00093 this->_checkErrorODBC3(SQL_HANDLE_DBC, hdbc, r, ODBCXX_STRING_C(what));00094 00095 <font class="preprocessor">#endif</font>00096 <font class="preprocessor"></font> }00097 }00098 00099 <font class="keywordtype">void</font> _checkEnvError(SQLHENV henv,00100 SQLRETURN r,00101 <font class="keyword">const</font> ODBCXX_CHAR_TYPE* what=ODBCXX_STRING_CONST(<font class="stringliteral">""</font>)) {00102 <font class="keywordflow">if</font>(r==SQL_SUCCESS_WITH_INFO || r==SQL_ERROR) {00103 <font class="preprocessor">#if ODBCVER < 0x0300</font>00104 <font class="preprocessor"></font> 00105 this->_checkErrorODBC2(henv,SQL_NULL_HDBC,SQL_NULL_HSTMT,r,00106 ODBCXX_STRING_C(what));00107 00108 <font class="preprocessor">#else</font>00109 <font class="preprocessor"></font> 00110 this->_checkErrorODBC3(SQL_HANDLE_ENV,henv,r,ODBCXX_STRING_C(what));00111 00112 <font class="preprocessor">#endif</font>00113 <font class="preprocessor"></font> }00114 }00115 00117 ErrorHandler(<font class="keywordtype">bool</font> collectWarnings =<font class="keyword">true</font>);00118 00119 <font class="keyword">public</font>:00121 <font class="keywordtype">void</font> clearWarnings();00122 00127 WarningList* getWarnings();00128 00130 <font class="keyword">virtual</font> ~ErrorHandler();00131 };00132 00133 00134 } <font class="comment">// namespace odbc</font>00135 00136 <font class="preprocessor">#endif</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 + -