#ifndef _GATS_DB_MYSQL_H_
#define _GATS_DB_MYSQL_H_
/**
@file GATS_DB_mysql.h
@brief Header file for the GATS_DB_mysql class.
@date $Date$
@version $Rev$
@author
- Lance Deaver
@copyright
(©) Copyright 2006 by GATS Inc.
11864 Canon Blvd., Suite 101, Newport News, VA 23606
All Rights Reserved. No part of this software or publication may be
reproduced, stored in a retrieval system, or transmitted, in any form
or by any means, electronic, mechanical, photocopying, recording, or
otherwise without the prior written permission of GATS Inc.
@see gatsDBpp::GATS_DB_mysql
@bug None known
$Id$
*/
#include "GATS_DB.h"
#include "ColData.h"
#include
#include
namespace gatsDBpp {
class GATS_DB_mysql : public GATS_DB
{
public:
/**
* @brief The class constructor
*/
GATS_DB_mysql(const char* user, const char* passwd,
const char* database= NULL ,
const char* host="localhost",
const unsigned int port=0, const char* unix_socket=NULL,
unsigned long int client_flag=0 );
/**
* @brief The class destructor.
*/
virtual ~GATS_DB_mysql();
/**
* @brief Send a SQL statement to the server and receive the result set
*/
GATS_DB_Results Query(const char* sqlstring, const unsigned long int length=0) ;
/**
* @brief Return the Number of Rows affected by the last Query.
*/
unsigned long long int AffectedRows() ;
/**
* @brief Change the current connection so that it uses a different database.
*/
void SelectDB(const char* db_name) ;
/**
* @brief Return the tables names in the current database.
*/
std::vector TableNames(const char* wild = NULL) ;
/**
* @brief Return a list of database names.
*/
std::vector DBNames(const char* wild = NULL) ;
/**
* @brief Return the field names in a specified table
*/
std::vector FieldNames(const char* tablename, const char* wild = NULL) ;
/**
* @brief Update a table row or number of rows
*/
void UpdateTable(const char* table, const std::vector >& fields,
const char* whereclause, const unsigned long wherelen=0 ) ;
/**
* @brief Insert a row into a table.
*/
void InsertIntoTable(const char* table, const std::vector >& fields ) ;
protected:
GATS_DB_mysql(const GATS_DB_mysql& db) {}
GATS_DB_mysql& operator=(const GATS_DB_mysql& rhs) { return *this; }
MYSQL* _connection;
};
} //end namespace
#endif //_GATS_DB_MYSQL_H_