#ifndef _GATS_DB_H_
#define _GATS_DB_H_
/**
@file GATS_DB.h
@brief Header file for the GATS_DB pure virtual base 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
@see gatsDBpp::ColData
@bug None known
$Id$
*/
#include "ColData.h"
namespace gatsDBpp
{
typedef std::vector< std::vector > GATS_DB_Results;
class GATS_DB
{
public:
GATS_DB() {}
virtual ~GATS_DB() {}
/**
* @brief Send a SQL statement to the server and receive the result set
*/
virtual GATS_DB_Results Query(const char* sqlstring, const unsigned long int length=0) =0;
/**
* @brief Return the Number of Rows affected by the last Query.
*/
virtual unsigned long long int AffectedRows() = 0;
/**
* @brief Change the current connection so that it uses a different database.
*/
virtual void SelectDB(const char* db_name) = 0;
/**
* @brief Return the tables names in the current database.
*/
virtual std::vector TableNames(const char* wild=NULL) = 0;
/**
* @brief Return a list of database names.
*/
virtual std::vector DBNames(const char* wild=NULL) =0 ;
/**
* @brief Return the field names in a specified table
*/
virtual std::vector FieldNames(const char* tablename, const char* wild=NULL) =0 ;
/**
* @brief Update a table row or number of rows
*/
virtual void UpdateTable(const char* table, const std::vector >& fields,
const char* whereclause, const unsigned long wherelen=0) =0 ;
/**
* @brief Insert a row into a table.
*/
virtual void InsertIntoTable(const char* table, const std::vector >& fields ) = 0;
};
} // namespace
#endif //_GATS_DB_H_