Giter Club home page Giter Club logo

mysqlapiagent's Introduction

MySQLAPIAgent

为MySQL数据库 API提高性能C++封装! Sample Code:

try { // 使用数据信息构造连接对象指针 CMySQLAgent* pMySQLAgent = new CMySQLAgent(m_strServerIP,m_strDBAccount,m_strDBPassword,m_strDBName,m_nDBPort);

	// 支持类似printf函数格式不定参数输入,并将结果返回到结果集对象Result中
	CMyResult Result = pMySQLAgent->Query("select orgname,coding from organization order by coding where deviceid = %s",m_strDevID);
	
	int nIndex = 0;
	do 
	{
		// 支持以列名直接获取数据结,并根据变量类型自动返回相应数据
		string strOgrname = Result["orgname"];
		string strCoding = Result["coding"];
		
	} while (++Result);	// 目前结果集CMyResult类仅支持前置自增操作,即类型++Result
	
	// CMyResult对象可以直接赋值新的结值,原结果集将被释放
	Result = pMySQLAgent->Query("SELECT max(`deviceid`) AS maxDevid FROM devices;");
	
	string strMaxID = Result["maxDevid"];
	
}
catch (CMySQLException& e)
{// 当连接数据异常,访问字段名不存在时,将会抛出异常,e.what_返回具体异常描述信息
	string strException = e.what_;
}
catch(std::exception &e)
{
	const char *szError = e.what();
}

mysqlapiagent's People

Contributors

leithergit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.