Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1800115
  • 博文数量: 600
  • 博客积分: 10581
  • 博客等级: 上将
  • 技术积分: 6205
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-06 10:13
文章分类
文章存档

2016年(2)

2015年(9)

2014年(8)

2013年(5)

2012年(8)

2011年(36)

2010年(34)

2009年(451)

2008年(47)

分类: Oracle

2010-10-19 17:33:38

        int errnum = 0;
        errnum = OCIEnvInit( (OCIEnv **) &m_pOCIEnv, OCI_DEFAULT|OCI_THREADED, (size_t) 0,
                     (dvoid **) 0 );
        if(errnum) {
                Debug(__LINE__,__FILE__,"Initializing to Execute OCIEnvInit");
                return -1;
        }
        errnum = OCIEnvCreate( &m_pOCIEnv, OCI_OBJECT, (dvoid *)0, (dvoid *(*)(dvoid *, size_t))0,
                (dvoid *(*)(dvoid *, dvoid *, size_t))0, (void (*)(dvoid *, dvoid *))0, (size_t)0, (dvoid **)0);
        if(errnum) {
                Debug(__LINE__,__FILE__,"Initializing to Execute OCIEnvCreate");
                return -1;
        }
        errnum = OCIHandleAlloc((dvoid *)m_pOCIEnv, (dvoid **)&m_pOCIError, OCI_HTYPE_ERROR, (size_t)0, (dvoid **)0);
        if(errnum) {
                Debug(__LINE__,__FILE__,"Initializing to Execute OCIHandleAlloc");
                return -1;
        }
        errnum = OCIHandleAlloc((dvoid *)m_pOCIEnv, (dvoid **) &m_pOCIServer, OCI_HTYPE_SERVER, (size_t) 0, (dvoid **) 0);
        if(errnum != OCI_SUCCESS) {
                Debug(__LINE__,__FILE__,"Execute OCIHandleAlloc");
                dbReportError(m_pOCIError);
                return -1;
        }
        errnum= OCILogon(m_pOCIEnv, m_pOCIError, &m_pOCISvcCtx, (const OraText*)db_username, strlen(db_username),(const OraText*)db_
password,strlen(db_password), (const OraText*)OracleTnsNames, strlen(OracleTnsNames));
        if(errnum) {
                Debug(__LINE__,__FILE__,"Initializing to Execute OCILogon");
                dbReportError(m_pOCIError);
                return -1;
        }
        errnum = OCIHandleAlloc((dvoid *)m_pOCIEnv, (dvoid **)&m_pOCIStmt, OCI_HTYPE_STMT, (size_t)0, (dvoid **)0);
        if ( errnum ) {
                Debug(__LINE__,__FILE__,"Execute OCIHandleAlloc");
                dbReportError(m_pOCIError);
                return -1;
        }
阅读(1919) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~