#ifndef _OTL_ORACLE_H_
#define _OTL_ORACLE_H_
#ifdef WIN32
#include <windows.h>
#endif
#include <vector>
#include <base/common.h>
#include <base/string_util.h>
#include <boost/thread/mutex.hpp>
#define OTL_DB2_CLI //OTL_ORA9I
#include "../otlv4.h"
namespace thefox{
namespace db{
class otl_oracle{
public:
typedef std::vector<string> Row;
typedef std::vector<Row> Table;
otl_oracle();
~otl_oracle();
void SetConnStr(const string &connStr);
bool Connect();
void Disconnect();
bool GetValueInt(const std::string &sql,int64_t &value);
string GetValueStr(const std::string &sql);
Row GetRow(const std::string &sql);
Table GetTable(const std::string &sql);
// 得到一行中某个字段的数据
static inline string GetValueByIndex(const Row &row, unsigned int index)
{
if (index >= 0 && index < row.size()) {
return row[index];
使用otl监控oracle和DB2代码封装
最新推荐文章于 2021-04-06 04:25:21 发布