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) |