⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 otlhandle.h

📁 一个利用OTL访问ORACLE数据库的例子
💻 H
字号:
// OtlHandle.h: interface for the COtlHandle class.
// 
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_OTLHANDLE_H__F182EED1_51DA_408C_9552_7F7853265B24__INCLUDED_)
#define AFX_OTLHANDLE_H__F182EED1_51DA_408C_9552_7F7853265B24__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////
#include <iostream>
#include <stdio.h>
#include <string>

#define  OTL_ORA9I // Compile OTL 4/OCI8
//#define OTL_ODBC     // Compile OTL 4/OCI8
///////////////////////////////////////////////////
#ifndef _MSC_VER
#define _MSC_VER
#endif

#if defined(_MSC_VER) // VC++
#define OTL_BIGINT __int64
#define OTL_STR_TO_BIGINT(str,n)  \
{                                 \
   n = _atoi64(str);              \
}

#define OTL_BIGINT_TO_STR(n,str)  \
{                                 \
   _i64toa(n,str,10);             \
}
#endif
//
#if defined(__GNUC__) // GNU C++
#include <stdlib.h>
#define OTL_BIGINT long long
#define OTL_STR_TO_BIGINT(str,n)      \
{                                     \  
   n = strtoll(str,0,10);             \
}
#define OTL_BIGINT_TO_STR(n,str)      \
{                                     \  
   sprintf(str,"%lld",n);             \
}
#endif
#include "otlv4.h"   // include the OTL 4 header file

using namespace std;

class COtlHandle  
{
public:
	COtlHandle();
	virtual ~COtlHandle();
public:
	otl_connect m_db;
public:
    bool ConnectDB(const char * strConn); //建立数据库连接
	bool ExcuteSQL(const char * strSQL);  //直接执行
	bool GetDataSetFromDB(const char * strQuery,otl_stream * pDataSet);  
	void SetMaxLongSize( const int nSize )
	{
		m_db.set_max_long_size( nSize );
	}
private:
	void ini_otl();                       
	void fini_otl();
};

#endif // !defined(AFX_OTLHANDLE_H__F182EED1_51DA_408C_9552_7F7853265B24__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -