易截截图软件、单文件、免安装、纯绿色、仅160KB

mysql connect c++

先前在测试mysql connect c++接口的时候运行其官方提供的例子
21.5.5.6. MySQL Connector/C++ Complete Example 2
The following code shows a complete example of how to use MySQL Connector/C++:
/* Copyright 2008 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
There are special exceptions to the terms and conditions of the GPL
as it is applied to this software. View the full text of the
exception in file EXCEPTIONS-CONNECTOR-C++ in the directory of this
software distribution.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* Standard C++ includes */
#include <stdlib.h>
#include <iostream>
/*
Include directly the different
headers from cppconn/ and mysql_driver.h + mysql_util.h
(and mysql_connection.h). This will reduce your build time!
*/
#include "mysql_connection.h"
#include <cppconn/driver.h>
#include <cppconn/exception.h>
#include <cppconn/resultset.h>
#include <cppconn/statement.h>
#include <cppconn/prepared_statement.h>
using namespace std;
int main(void)
{
cout << endl;
cout << "Let's have MySQL count from 10 to 1..." << endl;
try {
sql::Driver *driver;
sql::Connection *con;
sql::Statement *stmt;
sql::ResultSet *res;
sql::PreparedStatement *pstmt;
/* Create a connection */
driver = get_driver_instance();
con = driver->connect("tcp://127.0.0.1:3306", "root", "root");
/* Connect to the


相关文档:

C/C++面试题六(经典) 【转】

1.求下面函数的返回值(微软)
int func(x)
{
    int countx = 0;
    while(x)
    {
          countx ++;
          x = x&(x-1);
     } ......

php mysql 配置php.ini

文件php.ini放入windows下,将下面内容拷贝到记事本命名为php.ini放入c:/windows下,重启Apache server:
[PHP]
;;;;;;;;;;;
; WARNING ;
;;;;;;;;;;;
; This is the default settings file for new PHP installations.
; By default, PHP installs itself with a configuration suitable for
; development purposes ......

CentOS apache+mysql+php安装

CENTOS 5的虚拟机,怎么从图形界面切换到命令行界面
1.临时切换:
ctrl+alt+1 …… ctrl+alt+6一共六个控制台。
2.永久关闭图形化:
在root下输入 vi /etc/inittab 将init:5修改为init:3 
Mysql rpm包安装,不能重定位(relocatable)
rpm包安装异常,--prefix 参数不能重定位,安装到另一个目录的原 ......

(mysql)存储过程

(1)
存储过程是数据库服务器端的一段程序.
mysql的存储过程,只有版本是mysql5.0或以上的才有此特性.
(2)
什么时候需要用存储过程
存储过程通常是一些经常要执行的任务,这些任务往往是针对大量的记录而进行的。在服务器上执行存储过程,可以
改善应用程序的性能。这是因为:
2.1.
服务器往往具有强大的计算能力和速 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号