📄 drivermanager_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++/drivermanager.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++/drivermanager.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_DRIVERMANAGER_H</font>00023 <font class="preprocessor"></font><font class="preprocessor">#define __ODBCXX_DRIVERMANAGER_H</font>00024 <font class="preprocessor"></font>00025 <font class="preprocessor">#include <odbc++/setup.h></font>00026 00027 <font class="preprocessor">#include <odbc++/types.h></font>00028 00030 <font class="keyword">namespace </font>odbc {00031 00032 <font class="keyword">class </font>Connection;00033 <a name="l00036"></a><a class="code" href="classodbc_1_1_driver.html">00036</a> <font class="keyword">class </font>ODBCXX_EXPORT Driver {00037 <font class="keyword">private</font>:00038 ODBCXX_STRING description_;00039 std::vector<ODBCXX_STRING> attributes_;00040 00041 Driver(<font class="keyword">const</font> Driver&); <font class="comment">//forbid</font>00042 Driver& operator=(<font class="keyword">const</font> Driver&); <font class="comment">//forbid</font>00043 00044 <font class="keyword">public</font>:<a name="l00046"></a><a class="code" href="classodbc_1_1_driver.html#a0">00046</a> Driver(<font class="keyword">const</font> ODBCXX_STRING& description,00047 <font class="keyword">const</font> std::vector<ODBCXX_STRING>& attributes)00048 :description_(description), attributes_(attributes) {}00049 <a name="l00051"></a><a class="code" href="classodbc_1_1_driver.html#a1">00051</a> <font class="keyword">virtual</font> ~Driver() {}00052 <a name="l00054"></a><a class="code" href="classodbc_1_1_driver.html#a2">00054</a> <font class="keyword">const</font> ODBCXX_STRING& getDescription()<font class="keyword"> const </font>{00055 <font class="keywordflow">return</font> description_;00056 }00057 <a name="l00059"></a><a class="code" href="classodbc_1_1_driver.html#a3">00059</a> <font class="keyword">const</font> std::vector<ODBCXX_STRING>& getAttributes()<font class="keyword"> const </font>{00060 <font class="keywordflow">return</font> attributes_;00061 }00062 };00063 00065 <font class="keyword">typedef</font> CleanVector<Driver*> <a class="code" href="namespaceodbc.html#a0">DriverList</a>;00066 00067 <a name="l00069"></a><a class="code" href="classodbc_1_1_data_source.html">00069</a> <font class="keyword">class </font>ODBCXX_EXPORT DataSource {00070 <font class="keyword">private</font>:00071 ODBCXX_STRING name_;00072 ODBCXX_STRING description_;00073 00074 <font class="keyword">public</font>:<a name="l00076"></a><a class="code" href="classodbc_1_1_data_source.html#a0">00076</a> DataSource(<font class="keyword">const</font> ODBCXX_STRING& name, <font class="keyword">const</font> ODBCXX_STRING& description)00077 :name_(name), description_(description) {}00078 <a name="l00080"></a><a class="code" href="classodbc_1_1_data_source.html#a1">00080</a> <font class="keyword">virtual</font> ~DataSource() {}00081 <a name="l00083"></a><a class="code" href="classodbc_1_1_data_source.html#a2">00083</a> <font class="keyword">const</font> ODBCXX_STRING& getName()<font class="keyword"> const </font>{00084 <font class="keywordflow">return</font> name_;00085 }00086 <a name="l00088"></a><a class="code" href="classodbc_1_1_data_source.html#a3">00088</a> <font class="keyword">const</font> ODBCXX_STRING& getDescription()<font class="keyword"> const </font>{00089 <font class="keywordflow">return</font> description_;00090 }00091 };00092 00094 <font class="keyword">typedef</font> CleanVector<DataSource*> <a class="code" href="namespaceodbc.html#a1">DataSourceList</a>;00095 00096 <a name="l00099"></a><a class="code" href="classodbc_1_1_driver_manager.html">00099</a> <font class="keyword">class </font>ODBCXX_EXPORT DriverManager {00100 <font class="keyword">private</font>:00101 <font class="keyword">static</font> SQLHENV henv_;00102 <font class="keyword">static</font> ErrorHandler* eh_;00103 <font class="keyword">static</font> <font class="keywordtype">int</font> loginTimeout_;00104 00105 <font class="keyword">static</font> <font class="keywordtype">void</font> _checkInit();00106 <font class="keyword">static</font> Connection* _createConnection();00107 00108 <font class="comment">// forbid</font>00109 DriverManager();00110 00111 <font class="keyword">public</font>:00112 00114 <font class="keyword">static</font> Connection* getConnection(<font class="keyword">const</font> ODBCXX_STRING& dsn,00115 <font class="keyword">const</font> ODBCXX_STRING& user,00116 <font class="keyword">const</font> ODBCXX_STRING& password);00117 00121 <font class="keyword">static</font> Connection* getConnection(<font class="keyword">const</font> ODBCXX_STRING& connectString);00122 00126 <font class="keyword">static</font> <font class="keywordtype">int</font> getLoginTimeout();00127 00132 <font class="keyword">static</font> <font class="keywordtype">void</font> setLoginTimeout(<font class="keywordtype">int</font> seconds);00133 00136 <font class="keyword">static</font> <a class="code" href="namespaceodbc.html#a1">DataSourceList</a>* getDataSources();00137 00140 <font class="keyword">static</font> <a class="code" href="namespaceodbc.html#a0">DriverList</a>* getDrivers();00141 00145 <font class="keyword">static</font> <font class="keywordtype">void</font> shutdown();00146 };00147 00148 00149 00150 } <font class="comment">// namespace odbc</font>00151 00152 00153 <font class="preprocessor">#endif // __ODBCXX_DRIVERMANAGER_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 + -