#ifndef ORACLEDB_H #define ORACLEDB_H #include #include #include //use when to compile on outdated slc #include #include #include #include "occi.h" using namespace std; using namespace oracle::occi; class OracleDB { public: OracleDB() throw (SQLException); ~OracleDB() throw (SQLException); void connect( string user, string password, string connectString ) throw (SQLException); void disconnect() throw (SQLException); bool isConnected(); void executeUpdate( string query ) throw (SQLException); void executeQuery( string query ) throw (SQLException); void freeResult() throw (SQLException); void getRow() throw (SQLException); void calcRowCount( string query ) throw (SQLException); int32_t getRowCount() throw (SQLException); int32_t getFieldCount() throw (SQLException); void printFieldNames() throw (SQLException); int32_t getRowValueAsInt( int32_t colum ) throw (SQLException); string getRowValueAsString( int32_t colum ) throw (SQLException); string getRowValueDateAsString( int32_t colum ) throw (SQLException); double getRowValueAsDouble(int32_t column) throw (SQLException); float getRowValueAsFloat(int32_t column) throw (SQLException); uint32_t getRowValueAsBlob(int32_t column, char *buffer) throw (SQLException); // Oracle functions for paramerized statements (using bind variables) void createTransaction() throw (SQLException); void setSQL( string query ) throw (SQLException); void setSQLgetRowCount(string query) throw (SQLException); void setString(uint32_t paramIndex, const string val) throw (SQLException); void setNumber(uint32_t paramIndex, const int32_t val) throw (SQLException); void setDate(uint32_t paramIndex, const Date val) throw (SQLException); void setDouble(uint32_t paramIndex, const double val) throw (SQLException); void setFloat(uint32_t paramIndex, const float val) throw (SQLException); void setBlob(uint32_t paramIndex, const char *buffer, uint32_t bufsize) throw (SQLException); void executeQuery() throw (SQLException); void executeUpdate() throw (SQLException); void deleteTransaction() throw (SQLException); private: Environment *fenv; // Oracle Environment Connection *fconn; // Oracle Connection Statement *fstat; // Oracle Statement ResultSet *fresSet; // Oracle Result Set std::vector *fieldInfo; int32_t frowCount; int32_t ffieldCount; bool newQuery; }; #endif // ORACLEDB_H