Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members  

ODBCQuery.h

00001 /*
00002    Copyright (C) 2002 the Strongroom project
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    @author Ewald Snel
00010 */
00011 
00012 #ifndef __ODBCQUERY_H
00013 #define __ODBCQUERY_H
00014 
00015 #include <inttypes.h>
00016 #include <sqltypes.h>
00017 #include <string>
00018 
00019 #include <ODBCConnection.h>
00020 
00021 
00022 using namespace std;
00023 
00027 class ODBCQuery
00028 {
00029 public:
00034     ODBCQuery( ODBCConnection &odbc );
00035 
00039     ~ODBCQuery();
00040 
00044     ODBCQuery &param( bool *pValue );
00045 
00049     ODBCQuery &param( char *pValue );
00050 
00054     ODBCQuery &param( int *pValue );
00055 
00059     ODBCQuery &param( int64_t *pValue );
00060 
00064     ODBCQuery &param( const char *pValue );
00065 
00069     ODBCQuery &binParam();
00070 
00074     ODBCQuery &column( bool *pValue );
00075 
00079     ODBCQuery &column( char *pValue );
00080 
00084     ODBCQuery &column( int *pValue );
00085 
00089     ODBCQuery &column( int64_t *pValue );
00090 
00096     int exec( const char *query );
00097 
00102         void listTables();
00103                 
00108     bool fetch();
00109 
00114     bool commit();
00115 
00120     bool rollback();
00121 
00128     bool getText( int column, string &str );
00129 
00137     int getData( int column, uint8_t *buffer, int maxlen );
00138 
00145     int putData( const uint8_t *buffer, int length );
00146 
00151     int paramData();
00152 
00157     void error( int lineno );
00158 
00159 private:
00160     ODBCQuery( const ODBCQuery & );
00161     ODBCQuery &operator=( const ODBCQuery & );
00162 
00163     ODBCConnection &odbc;
00164     SQLHDBC hdbc;
00165     SQLHSTMT hstmt;
00166     SQLINTEGER binParamLength;
00167     int paramIndex;
00168     int columnIndex;
00169 };
00170 
00171 #endif

Generated on Wed Feb 18 13:45:55 2004 for strongroom by doxygen1.2.18