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

📄 main_so.cpp

📁 C++连接一写常用数据库的接口
💻 CPP
字号:
/* * mSQL Driver Implementation * Exports the public methods used to create and instance of the driver under unix. * Copyright (C) 2003 Johnathan Ingram, jingram@rogueware.org * * This library is free software; you can redistribute it and/or *   modify it under the terms of the GNU Lesser General Public *   License as published by the Free Software Foundation; either *   version 2.1 of the License, or (at your option) any later version. * *   This library is distributed in the hope that it will be useful, *   but WITHOUT ANY WARRANTY; without even the implied warranty of *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU *   Lesser General Public License for more details. * *   You should have received a copy of the GNU Lesser General Public *   License along with this library; if not, write to the Free Software *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  US * */#include <string.h>#include <string>#include "baseConnection.h"#include "msqlConnection.h"using namespace std;//Stop the C++ name manglingextern "C"{/* Create an instance of the driver.  * @param  argc     Number of parameters and values. * @param  argv     Parameters that can be used to instantiate the driver with. * * @return          Return the instance or NULL if an error occured. */void*createDriverInstance(int argc, const char** argv){   try   {      MsqlConnection *msqlConnection = NULL;      msqlConnection = new MsqlConnection(argc, argv);      return (void*)msqlConnection;   }   catch(...)   {      return NULL;   }}/* Destroy an instance of the driver. * * @return        Return NULL for success or the the pointer to the instance for failure. * * @param  driver The pointer to the driver instance. */void*destroyDriverInstance(   void* driver){   MsqlConnection *msqlConnection = (MsqlConnection*)driver;      if (msqlConnection)   {      // Make sure we have the correct driver.           if (strcmp( msqlConnection->driverName.c_str(), MSQL_DRIVERNAME) != 0)         return driver;      // Free the driver.      delete msqlConnection;   }   return NULL;}   /* Get the author of the driver. * * @return          Return the author. */const char*getAuthor(){   return "Johnathan Ingram, jingram@rogueware.org";}/* Get the vendor information of the driver. * * @return          Return the vendor. */const char*getVendor(){   return "Rogueware, www.rogueware.org, GNU";}  /* Get the copyright information of the driver. * * @return          Return the copyright information. */const char*getCopyright(){   return "Copyright (C) 2003 Johnathan Ingram, jingram@rogueware.org";}  /* Get the driver type * * @return          Return the driver type. */const char*getDriverType(){   return "RDMS";}  /* Get the name of the driver. * * @return          Return the driver name. */const char*getDriverName(){     return MSQL_DRIVERNAME;}/* Get the description of the driver. * * @return          Return the driver description. */const char*getDriverDesc(){     return "Mini SQL Version 3 Database Driver (mSQL) ";}/* Returns the version of DbConnect this driver was compiled with. * * @return          Return the DbConnect version. */const char*getDbConnectVersion(){   return DBCONNECTVER;}} // extern "C"

⌨️ 快捷键说明

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