Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

OCCI (v19.5) createEnvironment crashes with 32104

4182438Feb 5 2020 — edited Feb 10 2020

I Build my simple project in MSVC19, and I can't this code work.

#include "iostream"

#include "occi.h"

using namespace std;

using namespace oracle::occi;

#define db_user_name "test"

#define db_password "test"

#define db_conn_str "service"

int main(int argc, char* argv[])

{

    try

    {

        Environment* env = Environment::createEnvironment(Environment::OBJECT); // in line with error => goto catch block and return 32104

        Connection* conn = env->createConnection(db_user_name, db_password, db_conn_str);

        Statement* stmt = conn->createStatement("Select 1 from dual");

        ResultSet* rs = stmt->executeQuery();

        int res = 0;

        while (rs->next())

        {

            res = rs->getInt(1);

        }

        stmt->closeResultSet(rs);

        env->terminateConnection(conn);

        Environment::terminateEnvironment(env);

    }

    catch (SQLException & sqlExcp)

    {

        std::string temp = sqlExcp.getMessage();

        std::cerr << sqlExcp.getErrorCode() << " " << sqlExcp.getMessage() << std::endl;

    }

    system("pause");

    return 0;

}

Post Details

Added on Feb 5 2020
1 comment
1,319 views