![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
00001 /* 00002 Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved. 00003 00004 The MySQL Connector/C++ is licensed under the terms of the GPL 00005 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most 00006 MySQL Connectors. There are special exceptions to the terms and 00007 conditions of the GPL as it is applied to this software, see the 00008 FLOSS License Exception 00009 <http://www.mysql.com/about/legal/licensing/foss-exception.html>. 00010 */ 00011 00012 #ifndef _SQL_DRIVER_H_ 00013 #define _SQL_DRIVER_H_ 00014 00015 #include <string> 00016 #include <map> 00017 #include "connection.h" 00018 #include "build_config.h" 00019 00020 namespace sql 00021 { 00022 00023 class CPPCONN_PUBLIC_FUNC Driver 00024 { 00025 protected: 00026 virtual ~Driver() {} 00027 public: 00028 // Attempts to make a database connection to the given URL. 00029 00030 virtual Connection * connect(const std::string& hostName, const std::string& userName, const std::string& password) = 0; 00031 00032 virtual Connection * connect(std::map< std::string, ConnectPropertyVal > & options) = 0; 00033 00034 virtual int getMajorVersion() = 0; 00035 00036 virtual int getMinorVersion() = 0; 00037 00038 virtual int getPatchVersion() = 0; 00039 00040 virtual const std::string & getName() = 0; 00041 }; 00042 00043 } /* namespace sql */ 00044 00045 extern "C" 00046 { 00047 CPPCONN_PUBLIC_FUNC sql::Driver *get_driver_instance(); 00048 } 00049 00050 #endif /* _SQL_DRIVER_H_ */
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.