Oracle OCCI

Hi,
We're considering to change the way to access from Tuxedo services to Oracle. We need to implement a business logic layer that can be used from Tuxedo services and from a different kind of C++ programs, so we though to use OCCI might be a good idea.
Is there any success story using OCCI? If so, what are the main differences between using the OCCI and ProC? (I mean in terms of configuring Tuxedo, tpsvrinit code, getting XA environment, etc.)
Thanks in advance
Jorge Ortiz
P.S: we're using Tuxedo 8.1 and Oracle 10g.

Hi,
First of all, OCCI is not OCI. Internally it's based on OCI, but it's the C++ interfaz.
I've made same tests and it seems it works properly, even with multithreaded server. I can attach to the XA transaction manager and keep OCCI code inside global XA transactions scope.
Anyway, I'd like to hear about someone that has successfully implemented this kind of DB access. It's an important decission in my architecture and I don't feel very comfortable being a pioneer.
Thanks,
Jorge

Similar Messages

  • How to convert data buffer of type "oracle::occi::OCCI_SQLT_NUM" to double

    Hello All,
    I am using bulk reading by utilizing 'setDataBuffer()' method call and fetching N records at a time.
    It works well for fields of Oracle type VARCHAR, when I set
    h5. rs->setDataBuffer(col, buff, oracle::occi::OCCI_SQLT_CHR, size, lens, inds);
    and later iterating and interpreting data within 'buff' like this:
    h5. char* text = ((char*)buff) + size*i; <-- length is in lens array
    When the column's data type is NUMBER however, I am stuck.
    Indicating that data type to data buffer works well:
    h5. rs->setDataBuffer(col, buff, oracle::occi::OCCI_SQLT_NUM, size, lens, inds);
    I would like now to extract a value of c++ double type from that buffer.
    But I do not have an idea how to handle data within buff. I suppose it should have NUMBER stored inside in some internal format (just as described in Oracle® C++ Call Interface Programmer's Guide, section 'Description of External Datatypes', NUMBER)
    Gestures like casting to double or trying to interpet the buffer's inner as oracle::occi::Number do not produce sensible results.
    Could you help me to understand how can I obtain the double value from that buffer in a bulk read?

    I have the following code which has been working for me.
    showln ("Array Fetch");
    sql = "SELECT c1, c2, c3, c4 FROM nd17_otab";
    stmt->setSQL ( sql );
    OCCIResultSet *rs = stmt->executeQuery();
    rs->setDataBuffer (1, num, OCCIINT, sizeof(ub4), lenC1);
    rs->setDataBuffer (2, flt, OCCIBFLOAT, sizeof(float), lenC2);
    rs->setDataBuffer (3, dbl, OCCIBDOUBLE, sizeof(double), lenC3);
    rs->setDataBuffer (4, str, OCCI_SQLT_CHR, CHRS, lenC4);
    if ( rs->next(ROWS) )
    show ("Number of Rows Fetched: ") << rs->getNumArrayRows () << endl;
    showln ("Fetched Records");
    for (int j = 0; j < ROWS; j++ )
    show ("C1: ") << num[j] << endl;
    show ("C2: ") << flt[j] << endl;
    show ("C3: ") << dbl[j] << endl;
    show ("C4: ") << str[j] << endl;
    stmt->closeResultSet(rs);
    c1, c2, c3, c4 columns in table nd17_otab are of type NUMBER, BINARY_FLOAT, BINARY_DOUBLE & VARCHAR2

  • Link Error Linux AS3: undefined reference to `oracle::occi::Environment

    I got this error when i try to run sample database access using OCCI libraries.
    test.cpp:21: undefined reference to `oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode, void*, void* (*)(void*, unsigned int), void* (*)(void*, void*, unsigned int), void (*)(void*, void*))'
    Following link contains same problem but there is no answer.
    #include <iostream>
    #include <occi.h>
    using oracle::occi::Connection;
    using oracle::occi::Environment;
    using oracle::occi::Statement;
    using oracle::occi::ResultSet;
    using namespace std;
    int main() {
    Environment *environment;
    Connection *con;
    Statement* stmt;
    ResultSet* res;
    try {
    //std::cout << "dasfasfafa";
    environment = Environment::createEnvironment(oracle::occi::Environment::DEFAULT);
    con = environment->createConnection("aaa", "aaa", "Caaa");
    stmt = con->createStatement("select * from emp");
    res = stmt->executeQuery();
    while (res->next())
    std::cout << res->getInt(1) << " " << res->getString(2) << std::endl;
    stmt->closeResultSet(res);
    con->terminateStatement(stmt);
    environment->terminateConnection(con);
    } catch (oracle::occi::SQLException &e) {
    std::cout << e.what();
    return 0;
    }

    The demos have this:
    #include <iostream>
    #include <occi.h>
    using namespace oracle::occi;
    using namespace std;
    ...

  • Exceptions in oracle::occi::Environment's class terminate methods

    Could terminateEnvironment or terminateConnection oracle::occi::Environment's throw an Exception?
    I want to call this methods from a destructor and I must to know it (the doc say nothing)
    Thanks in advance!
    Best regards

    Hi,
    No, I just installed the application on one machine, so i can't reproduce it on another machine.What is the OS?
    Can you please explain what you mean by:
    see if the solution in (Note: 1076817.1 - Cannot Launch FDHM IN DBI, It Shows Blank Screen) helps.This is a My Oracle Support document -- https://support.oracle.com
    Thanks,
    Hussein

  • Crash in oracle::occi::Statement::execute

    Hello,
    Application essentially:
    Environment *environment = Environment::createEnvironment(Environment::DEFAULT);
    Connection *connection  = environment->createConnection(...);
    Statement *statement   = connection->createStatement( < as below>);
    statement->setPrefetchMemorySize(0);
    statement->setPrefetchRowCount(100);
    statement->execute(); // crash occurs here
    Library v. 11.2.0.3, Linux, 64bit.
    My program works fine with Statement::execute("select FEATURE_UID from PSV_FIELDS");
    My program crashes with Statement::execute("select * from PSV_FIELDS");
    The application works fine with other tables
    Does anyone know what the problem is, is it in my code, in the library, somewhere else. And is there a way I can write this so that it works ?
    Best Regards,
    Even
    SQL> describe PSV_FIELDS
    Name                         Null? Type
    MI_PRINX                         NUMBER
    FEATURE_UID                    NOT NULL VARCHAR2(38)
    FIELD                              VARCHAR2(100)
    COUNTRY                         VARCHAR2(100)
    OPERATOR                         VARCHAR2(100)
    STATUS                          VARCHAR2(100)
    DISCOVERY_                         VARCHAR2(100)
    DEVELOPMEN                         VARCHAR2(100)
    PRODUCTION                         VARCHAR2(100)
    TYPE                              VARCHAR2(100)
    ABANDONED_                         VARCHAR2(100)
    FEATURE_GEOMETRY                    MDSYS.SDO_GEOMETRY
    This is the valgrind report
    ==4285== Invalid read of size 8
    ==4285== at 0xF435929: ttca2p (in /usr/lib64/oracle/11.2.0.3/client/lib64/libclntsh.so.11.1)
    ==4285== by 0xDC021F1: ttcfopr (in /usr/lib64/oracle/11.2.0.3/client/lib64/libclntsh.so.11.1)
    ==4285== by 0xF41602A: ttcdrv (in /usr/lib64/oracle/11.2.0.3/client/lib64/libclntsh.so.11.1)
    ==4285== by 0xF3BF480: nioqwa (in /usr/lib64/oracle/11.2.0.3/client/lib64/libclntsh.so.11.1)
    ==4285== by 0xF3AD190: upirtrc (in /usr/lib64/oracle/11.2.0.3/client/lib64/libclntsh.so.11.1)
    ==4285== by 0xF3B37E1: kpurcsc (in /usr/lib64/oracle/11.2.0.3/client/lib64/libclntsh.so.11.1)
    ==4285== by 0xF3B07D2: kpuexec (in /usr/lib64/oracle/11.2.0.3/client/lib64/libclntsh.so.11.1)
    ==4285== by 0xF3ADCCC: OCIStmtExecute (in /usr/lib64/oracle/11.2.0.3/client/lib64/libclntsh.so.11.1)
    ==4285== by 0xC0DC05C: oracle::occi::StatementImpl::doOCIExecute() (in /usr/lib64/oracle/11.2.0.3/client/lib64/libocci.so.11.1)
    ==4285== by 0xC0DBFE3: oracle::occi::StatementImpl::do_execute() (in /usr/lib64/oracle/11.2.0.3/client/lib64/libocci.so.11.1)
    ==4285== by 0xC0DBF97: oracle::occi::StatementImpl::execute(std::string const&) (in /usr/lib64/oracle/11.2.0.3/client/lib64/libocci.so.11.1)
    ==4285== by 0xC0DC2ED: oracle::occi::StatementImpl::executeQuery(std::string const&) (in /usr/lib64/oracle/11.2.0.3/client/lib64/libocci.so.11.1)
    ==4285== Address 0xb0 is not stack'd, malloc'd or (recently) free'd

    The problem was that the environment had to be created with Environment::OBJECT and not Environment::DEFAULT. An exception would have been nice though.
    Best Regards,
    Even

  • Occi 11.1 Error on compile: undefined reference to `oracle::occi::Enviro...

    I'm trying to compile an hello world example on my computer. I've read the documentation for requirements occi on the site
    http://docs.oracle.com/cd/E11882_01/install.112/e24322/pre_install.htm#CHDHFGBJ
    It says that the g++ compiler 3.4.6 or later is supported. I have:
    Ubuntu 12.04
    gcc 4.6.3
    oracle instant client 11.2
    and the error is below, does anyone have a suggestion?
    g++ main.cpp -c -I/home/tim/skrivbord/bin/oracle/instantclient_11_2/include/ -D_REENTRANT -g -Wall
    g++ -o pippo -L/home/tim/skrivbord/bin/oracle/instantclient_11_2/ -locci -lclntsh -lociei -lnnz11 main.o
    main.o: In function `main':
    /home/tim/skrivbord/dev/cpp/main.cpp:21: undefined reference to `oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode, void*, void* (*)(void*, unsigned int), void* (*)(void*, void*, unsigned int), void (*)(void*, void*))'
    collect2: ld returned 1 exit status
    make: *** [buildocci] Error 1
    main.cpp:
    #include <iostream>
    #include <occi.h>
    using namespace std;
    using namespace oracle::occi;
    int main(){
    Environment *environment;
    environment = Environment::createEnvironment();
    return 0;
    }

    For correctness I will close this question. I had made some errors with my environment variables LD_LIBRARY_PATH and specially I did not have libaio installed which is well documented that it has to be.

  • Oracle::occi::SQLException ORA-01804

    I'm trying to connect to my oracle server using OCCI, my code runs when I run it from any client. but when I try to run it under the server itself, I get this error:
    terminate called after throwing an instance of 'oracle::occi::SQLException'
    what(): Error while trying to retrieve text for error ORA-01804
    It seems to be somehow a timezone problem, but my server time zone is equal to the database time zone and both are +0330.
    Using JDBC connection I can connect to the oracle server from the server itself. I confirmed it using sqldeveloper.
    How can I solve the problem?

    This is from babelfish
    I am migrating a data base 8i to 10g I am in the change of pro*c to occi, when I compile leaves the following thing to me: : undefined reference to ` oracle::occi::SQLException::SQLException(oracle::occi::SQLException const&) ' and other things the problem is that not if is a problem of path with librerias since it lowers librerias occi and it places in several sides but nothing, ademas I see that the file occiObjects.h has a problem in 146 line sera that what is the problem if alguin has solved to this please me envie the answer thanks. Daniel
    Best regards
    Maxim

  • An Oracle OCCI program compiled in Win 7 x86 VC++10 crashes in a Win XP Sp3

    Hi:
    I generated a VC++ program in my computer under Win 7 32bits linked to Oracle Instant Client OCCI 11.2.0.3 library. It works very well in my machine when selecting data from a database but, when I copy this executable together with oraocci11.dll (10.2.0.3 for VC10), oci.dll and tnsnames.ora to a client machine, which does not have VC++ but it has the VC10 distributable installed, it crashes with:
    Faulting application consoracle.exe, version 0.0.0.0, faulting module unknown, version 0.0.0.0, fault address 0x003b003a.
    in the 2nd line:
    env = Environment::createEnvironment (Environment::DEFAULT);
    conn = env->createConnection (user, passwd, db);
    (env has invalid reference)
    I spent many hours trying to solve this problem without success. The environment variables: path, ORACLE_HOME are appropiately configured.
    What do you thing is happening?
    Edited by: user594948 on 22-04-2012 05:58 AM

    I found the reason of the crash. In my case I must also include the next components:
    oraociei11.dll
    oraociei11.sym
    I really should install all the instantclient components in the user computer but does noy justify, because the standalone program I made only recovers little information.
    Regards.

  • Does Oracle occi have any memory bugs when writing blobs using streams?

    The function below will produce some kind of memory corruption that will cause an exception (which cannot be identified since memory is corrupted) while doing another call:
    ora::Statement stmt(__cn);
    string sql("BEGIN Pckg.Sp_procA(:1, :2, :3, :4, :5, :6, :7, :8, "
    ":9, :10, :11, :12, ":13, :14, :15, :payload); END;");
    occi::Blob payload(__cn.getConnection());
    occi::Environment* tempEnv = occi::Environment::createEnvironment();
    occi::Timestamp reportTime(tempEnv);
    reportTime.fromText(__report.report_time), "yyyy-mm-ddH24:mi:ss.ff");
    stmt.setSQL(sql);
    stmt.setString     (1, "");
    stmt.setString     (2, "");
    stmt.setString     (3, __report.varA);
    stmt.setString     (4, __report.varB);
    stmt.setInt          (5, __report.varC);
    stmt.setString     (6, __report.varD);
    stmt.setString     (7, __report.varE);
    stmt.setString     (8, __report.varF);
    stmt.setTimestamp(9, reportTime);
    stmt.setNull     (10, occi::OCCITIMESTAMP);
    stmt.setString     (11, __report.varG);
    stmt.setString     (12, __report.varH);
    stmt.setString     (13, __report.varI);
    stmt.setString     (14, __report.varK);
    stmt.setString     (15, __report.varX);
    stmt.setBinaryStreamMode(16, __report.payload.Size(), true);
    stmt.executeUpdate();
    occi::Stream* streamedData = stmt.getStream(16);
    streamedData->writeLastBuffer(__report.payload.GetPtr(), __report.payload.Size());
    stmt.closeStream(streamedData);
    occi::Environment::terminateEnvironment(tempEnv);
    return true;
    The function below works perfectly unless the code above is executed and looks like this:
    ora::Statement stmt(__cn);
    string sql("BEGIN "
    "Pckg.Sp_procB(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11); END;");
    occi::Environment* tempEnv = occi::Environment::createEnvironment();
    occi::Timestamp reportTime(tempEnv);
    reportTime.fromText(__report.report_time, "yyyy-mm-dd HH24:mi:ss.ff");
    stmt.setSQL(sql);
    stmt.setString     (1, "");
    stmt.setString     (2, "");
    stmt.setString     (3, __report.varA);
    stmt.setString     (4, __report.varB);
    stmt.setInt          (5, __report.varB);
    stmt.setString     (6, __report.varD);
    stmt.setString     (7, __report.varE);
    stmt.setString     (8, __report.varF);
    stmt.setString     (9, __report.varG);
    stmt.setTimestamp(10, reportTime);
    stmt.setNull     (11, occi::OCCITIMESTAMP);
    stmt.executeUpdate();
    occi::Environment::terminateEnvironment(tempEnv);
    return true;
    I got the blob insert example from Oracle's documentation and can't see anything wrong with it. The second function also seems to be ok which got me thinking that Oracle's occi might have some kind of bug that corrupts memory. Anyone knows anything about this or has done anything similar?

    Does anyone insert blobs this way? Or just using the "insert -> select for update" way?

  • VC++ 2008 Express Edition, OCCI oraocci10d.dll 10.2.0.1, DB Oracle 10g

    I am not able to run some basic code using OCCI. I am able to successfully compile and link the code.
    using namespace oracle::occi;
    class occidml
    private:
         Environment *env;
         Connection *conn;
         Statement *stmt;
    public:
         occidml(string user, string passwd,string db)
              //env = Environment::createEnvironment(Environment::DEFAULT);
              env = Environment::createEnvironment();
              conn = env->createConnection(user, passwd,db);
    Every time the constructor is called, it successfully creates the environment it appears, I have a watch on the env pointer and it has some address. But the createConnection fails so I catch the exception and try to getMessage, but that fails with
    "Unhandled exception at 0x005b8dcb in Oracle_Proj.exe: 0xC0000005: Access violation reading location 0xcccccccc."
    I am using the occi sample code and havent changed much. please help me. I have a long way to go to make the app work. I can provide you with any additional information required.
    Chad

    My suspicion is that you are using mismatched versions between OCCI/Oracle Client and the Microsoft runtime libraries. That's why I've asked about the versions. I don't know what version of OCCI/Oracle Client you are using, but if it is the version that ships with Oracle Database Expression Edition, that will be incorrect since that version is for VS2003/VC7.1. One potential issue when using mismatched versions is that the memory allocators/deallocators used to build OCCI may be different from the runtime versions, for example.
    EDIT1: Also, if using the debug build, you'll need to make sure that the oraocciXXd.dll is in the path. If it's not you should get an "application unable to start" type of message though. I don't have an Oracle Database Express Edition install handy at the moment, so I'm going somewhat from memory.
    Thanks,
    Mark
    Edited by: Mark Williams on Sep 1, 2010 1:42 PM

  • Error: ORA-01722 while connecting oracle using OCCI

    Please help,
    I get exception 1722 ORA-01722 Invalid Number while selecting records from oracle database using simple select statement.
    I have allready installed oracle 10.2.0.3.0 Patch 13 from oracle.com.
    Environment: win2k3 (sp2-32 bit), Oracle 10.2.0.3.0, VC++ 2005 (VC8)
    Dump of file vc8test.exe
    File Type: EXECUTABLE IMAGE
    Image has the following dependencies:
    MSVCR80.dll
    MSVCP80.dll
    oraocci10.dll
    KERNEL32.dll
    Summary
    1000 .data
    1000 .rdata
    1000 .rsrc
    2000 .text

    thanx for the reply, here is the source code:
    I am unable to connect to oracle, i have tried every possible combination.
    i had tested using vc++ 2005 and with vc++ 6.0
    The below code is tested on visual c++ 2005 and from oracle 10.2.0 client.
    #include <iostream>
    #include <occi.h>
    using namespace oracle::occi;
    using namespace std;
    class occidml
    private:
         Environment *env;
         Connection *conn;
         Statement *stmt;
    public:
         occidml(string user, string passwd, string db)
              env=Environment::createEnvironment(Environment::DEFAULT);
              conn=env->createConnection(user,passwd, db);
         ~occidml()
              env->terminateConnection(conn);
              Environment::terminateEnvironment(env);
         void displayAllRows()
                   string sqlStmt="select * from tcm_ref_city";
                   stmt=conn->createStatement(sqlStmt);
                   ResultSet *rset=stmt->executeQuery();
                   try{
                        while(rset->next()){
                             cout<< rset->getString(1)<<"\t"<<rset->getInt(2)<<endl;                         
                        }catch(SQLException ex){
                             cout<< "Exception\t"
                                  <<ex.getErrorCode()<<"\t"
                                  <<ex.getMessage()<<endl;
                             stmt->closeResultSet(rset);
                             conn->terminateStatement(stmt);
         int main(void)
              string usr="stltc";
              string pass="stltc";
              string db="stltc";
              int xx;
              cout<<"hello this is rakesh";
              occidml *demo=new occidml(usr,pass, db);
              demo->displayAllRows();
              cin>>xx;
              /*Environment *env1 ;
              Connection *conn;
              env1=Environment::createEnvironment(Environment::DEFAULT);
              Connection conn=env1->createConnection("STLIUC", "STLIUC","IAD");  /
              return 0;
    ******************************************************************************

  • Calling Oracle function and Procedure using OCCI with in C++ code

    Could any body send me the sample code to create and execute Oracle function and Procedure using OCCI concept in C++?.
    Edited by: 788634 on Aug 16, 2010 4:09 AM

    Hi Vishnu,
    Yes, sure, you can create a PL/SQL procedure, function, package, package body, etc. from within an OCCI application. I would say that, generally, this is not the sort of activity a typical client application would perform unless there is some initialization/installation processes that need to happen. In any case, here is a simple demo showing how to create a stand alone procedure (in a real application I would use a package and body) that returns a ref cursor. The ref cursor is just a simple select of two columns in the hr.countries sample table. Of course, there is no error handling, object orientation, etc. in this demo - I wanted to keep the code as short and as simple as possible to illustrate the concept.
    Regards,
    Mark
    #include <occi.h>
    #include <iostream>
    using namespace std;
    using namespace oracle::occi;
    int main(void)
      // occi variables
      Environment *env;
      Connection  *con;
      Statement   *stmt;
      ResultSet   *rs;
      // database connection information
      string user = "hr";
      string passwd = "hr";
      string db = "orademo";
      // sql to create the procedure which returns a ref cursor as out parameter
      // should be run as hr sample user or in a schema that has select privilege
      // on the hr.countries table and a synonym (countries) that points to the
      // hr.countries table
      string sqlCreate =
        "create or replace procedure get_countries(p_rc out sys_refcursor) as "
        "begin"
        " open p_rc for"
        " select country_id, country_name from countries order by country_name; "
        "end;";
      // pl/sql anonymous block to call the procedure
      string sqlCall = "begin get_countries(:1); end;";
      // create a default environment for this demo
      env = Environment::createEnvironment(Environment::DEFAULT);
      cout << endl;
      // open the connection to the database
      con = env->createConnection(user, passwd, db);
      // display database version
      cout << con->getServerVersion() << endl << endl;
      // create statement object for creating procedure
      stmt = con->createStatement(sqlCreate);
      // create the procedure
      stmt->executeUpdate();
      // terminate the statement object
      con->terminateStatement(stmt);
      // now create new statement object to call procedure
      stmt = con->createStatement(sqlCall);
      // need to register the ref cursor output parameter
      stmt->registerOutParam(1, OCCICURSOR);
      // call the procedure through the anonymous block
      stmt->executeUpdate();
      // get the ref cursor as an occi resultset
      rs = stmt->getCursor(1);
      // loop through the result set
      // and write the values to the console
      while (rs->next())
        cout << rs->getString(1) << ": " << rs->getString(2) << endl;
      // close the result set after looping
      stmt->closeResultSet(rs);
      // terminate the statement object
      con->terminateStatement(stmt);
      // terminate the connection to the database
      env->terminateConnection(con);
      // terminate the environment
      Environment::terminateEnvironment(env);
      // use this as a prompt to keep the console window from
      // closing when run interactively from the IDE
      cout << endl << "ENTER to continue...";
      cin.get();
      return 0;
    }

  • OCCI (Oracle 9i) in cygwin on W2K

    I would like to know if it's possible to compile and link the samples (for example occipool.cpp) in cygwin.
    I am having problems to link to the Oracle libraries. They all seems to be .lib and I was expecting something like .a or .so
    Thanks.

    Maybe I was not clear, but what I want to link with, are the OCCI libraries. And for some reason, this is not working (that's why I ask here and not in Cygwin forums).
    The compilation was fine, but the linking gives the message :
    undefined reference to `oracle::occi::Environment::createEnvironment
    That's Oracle specific.
    You say that there's a version using gcc 2.95.x does it have something to do with this :
    http://www.leroybrown.com/oracletips.html
    But this solution works for RedHat and I am using Cygwin.
    Please tell me if it is possible to link from Cygwin with libraries of the Oracle9i W2K installation.
    Here is the command :
    $ g++ ora_conn_pool.o
    -LE:/SW/DataBase/Oracle/ora92/oci/lib/msvc -lstdc++
    -lcygwin -loraocci9 -loci -o ora_conn_pool ora_conn_pool.o(.text$_ZN8occipoolC1Ev+0x32):ora_conn_pool.cpp: undefined reference to
    `oracle::occi::Environment::createEnvironment(oracle::occi::Environment::
    Mode, void*, void* (*)(void*, unsigned), void* (*)(void*, void*, unsigned), void (*)(void*, void*))' ora_conn_pool.o(.text$_ZN8occipoolD1Ev+0xf):ora_conn_pool.cpp: undefined reference to `oracle::occi::Environment::terminateEnvironment(oracle::occi::Environment*)'
    ora_conn_pool.o(.text$_ZN8occipool6selectEv+0x32f):ora_conn_pool.cpp: undefined reference to `oracle::occi::SQLException::SQLException[in-charge](oracle::occi::SQLException const&)'
    ora_conn_pool.o.text$_ZN8occipool6selectEv+0x378):ora_conn_pool.cpp: undefined reference to `oracle::occi::SQLException::getErrorCode() const'
    ora_conn_pool.o.text$_ZN8occipool6selectEv+0x3af):ora_conn_pool.cpp: undefined
    reference to `oracle::occi::SQLException::getMessage() const'ora_conn_pool.o.text$_ZN8occipool6selectEv+0x423):ora_conn_pool.cpp: undefined
    reference to `oracle::occi::SQLException::~SQLException [in-charge]()'
    ora_conn_pool.o(.text$_ZN8occipool6selectEv+0x436):ora_conn_pool.cpp: undefined
    reference to `oracle::occi::SQLException::~SQLException [in-charge]()'
    collect2: ld returned 1 exit status

  • Occi GetString causing a exception with ntdll.dll oracle 10g and MS 2005

    hi,
    I am getting an exception with using Visual Studio 2005(VC++8) and occi.h 10g client.
    When I run the release version I get an exception in ntdll.dll.
    The problem is in the getString(). The field in the oracle table is defined as a varchar2(300).
    I am new to oracle occi and need a solution because we cannot migrate to another version of the database.
    These are the solutions I have tried:
    download patches for MS Visual studio
    download patched for oracle 10g client
    Check that the charset it correct for std:string
    I see that others have had the same problem but no one has a solution. If anyone has a solution please email me because I have searched for days!
    Thanks
    Sheryl

    Aloha
    Thank you for your response, I am new to posting, occi and C++. Can I send you the files.
    Sorry didnt read this reply until today.
    The email is [email protected].
    This environment:
    1> windows xp
    2> MS Studio 5 VC++8
    3> OCCI 10.2.0.3.0 (patch 13)libraries for Microsoft Visual C++ 8
    4> I am using the Instant Client
    5> I am using /MD Multithreaded DLL
    6> Charset is oracle::occi::Environment::createEnvironment ("US7ASCII","AL16UTF16",Environment::DEFAULT);
    7> We running the application in release mode and getting this error with a bad memory reference on getString().
    I am getting a memory reference error on the getString(4).
    This is the code that is causing the error
    try
              string istmt ="SELECT FILE_ID,FILES.FTYP_ID,LTRIM(RTRIM(FILEPATH)),LTRIM(RTRIM(FILENAME)),TITLE FROM FILES,FILE_TYPES WHERE FILE_TYPES.EXTN = 'img'AND file_types.ftyp_id = files.ftyp_id AND FILES.HDR_SCAN_DATE IS NULL ORDER BY FILEPATH, FILENAME ";
              ResultSet * set = db->select(istmt);
              if (set == NULL)
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"No file to process occured in : %s ", methodName.c_str());
                   return;
              LogT::Get()->log(Logger::LOG_LEVEL_INFO,"Did select in : %s ", methodName.c_str());     
              while (set->next())
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"Doing a set next in : %s ", methodName.c_str());
                   if (set->isNull(1) || set->isNull(2) || set->isNull(4) || set->isNull(3))
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"a value is null continue in : %s ", methodName.c_str());
                        continue;
                   try {
                        LogT::Get()->log(Logger::LOG_LEVEL_INFO,"About to get string 3 in : %s ", methodName.c_str());
                        std::string test(set->getString(3));
                        fname.assign(test);
                        LogT::Get()->log(Logger::LOG_LEVEL_INFO,"File name: %s in : %s ",fname.c_str(), methodName.c_str());
                   } catch (exception ex9) {     
                        LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Exception in get string msg: occured in : %s ",ex9.what(), methodName.c_str());
                        continue;
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"getting int 1 in : %s ", methodName.c_str());
                   fid = set->getInt(1);
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"getting string 4 in : %s ", methodName.c_str());
                   fn.assign(set->getString(4));
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"after getting string 4 in : %s ", methodName.c_str());
                   //dont append a slash if not need
                   size_t pos = fname.find_last_of("\\");
                   if(pos != fname.length()-1)
                        fname.append("\\");
                   fname.append(fn);
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"adding %s to map in : %s ",fname.c_str(), methodName.c_str());
                   fnames.insert (std::pair<unsigned int,std::string>(fid,fname));
    //               int ftype = set->getInt(2);
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"got fid:%d, fname:%s fn: %s to map in : %s ",fid,fname.c_str(),fn.c_str(), methodName.c_str());
         catch (SQLException ex)
              LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Sql Exception code: %d message: %s occured in : %s ",ex.getErrorCode(),ex.getMessage().c_str(), methodName.c_str());
              db->exceptionHandler("SELECT PARAMS",ex.getErrorCode(),ex.getMessage());
              throw;
         catch (exception ex3)
              LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Exception occured message: %sin : %s ", ex3.what(),methodName.c_str());
              db->exceptionHandler("SELECT PARAMS",1,ex3.what());
              throw;
         catch (...) {
              LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Error occured in : %s ", methodName.c_str());
    This is the code for the select in occi
    /* Select statement for oracle occi*/
    void * OraDb::select(std::string& sqlStr,std::map<std::string,VALUES,classcomp> & val) {
         string methodName = "OraDb::select";
         ResultSet *selectRset;
         try {
              this->stmt->setSQL(sqlStr);
              this->bind(val);
              selectRset = this->stmt->executeQuery ();
              oracle::occi::Statement::Status res = this->stmt->status();
              while(res != oracle::occi::Statement::RESULT_SET_AVAILABLE) {
                   LogT::Get()->log(Logger::LOG_LEVEL_INFO,"the results set isnt ready");
                   res = this->stmt->status();
         catch (SQLException ex)
              LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Sql Error in %s code: %d Message:%s",methodName.c_str(),ex.getErrorCode(),ex.getMessage().c_str());
              //Add error to error log                          
              this->exceptionHandler(methodName,ex.getErrorCode(),ex.getMessage());
              throw;
         catch (exception ex3)
              LogT::Get()->log(Logger::LOG_LEVEL_ERROR,"Error in %s Message:%s",methodName.c_str(),ex3.what());
              this->exceptionHandler(methodName,1,ex3.what());
              //Add error to errorlog
              throw;
    return selectRset;
    This is the logs I get
    ParamsTb::selectImgParams
    in method OraDb::select this is the statement:SELECT FILE_ID,FILES.FTYP_ID,LTRIM(RTRIM(FILEPATH)),LTRIM(RTRIM(FILENAME)),TITLE FROM FILES,FILE_TYPES WHERE FILE_TYPES.EXTN = 'img'AND file_types.ftyp_id = files.ftyp_id AND FILES.HDR_SCAN_DATE IS NULL
    Did select in : FilesTb::selectImgFiles
    Doing a set next in : FilesTb::selectImgFiles
    About to get string 3 in : FilesTb::selectImgFiles
    File name: \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\CamIRa\fpa\384-for-MnM\ in : FilesTb::selectImgFiles
    getting int 1 in : FilesTb::selectImgFiles
    getting string 4 in : FilesTb::selectImgFiles
    after getting string 4 in : FilesTb::selectImgFiles
    adding \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\CamIRa\fpa\384-for-MnM\\foeHeaderAirplane.img to map in : FilesTb::selectImgFiles
    got fid:4766408, fname:\\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\CamIRa\fpa\384-for-MnM\\foeHeaderAirplane.img fn: foeHeaderAirplane.img to map in : FilesTb::selectImgFiles
    Doing a set next in : FilesTb::selectImgFiles
    About to get string 3 in : FilesTb::selectImgFiles
    File name: \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\HFDS20080826\384-for-MnM\ in : FilesTb::selectImgFiles
    getting int 1 in : FilesTb::selectImgFiles
    getting string 4 in : FilesTb::selectImgFiles
    after getting string 4 in : FilesTb::selectImgFiles
    adding \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\HFDS20080826\384-for-MnM\\foeHeaderAirplane.img to map in : FilesTb::selectImgFiles
    got fid:4778728, fname:\\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\MOST-1_backup\HFDS20080826\384-for-MnM\\foeHeaderAirplane.img fn: foeHeaderAirplane.img to map in : FilesTb::selectImgFiles
    Doing a set next in : FilesTb::selectImgFiles
    About to get string 3 in : FilesTb::selectImgFiles
    File name: \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\workstations\HFDS2-10-1-0-99\c\WINDOWS\system32\drivers\ in : FilesTb::selectImgFiles
    getting int 1 in : FilesTb::selectImgFiles
    getting string 4 in : FilesTb::selectImgFiles
    after getting string 4 in : FilesTb::selectImgFiles
    adding \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\workstations\HFDS2-10-1-0-99\c\WINDOWS\system32\drivers\\netwlan5.img to map in : FilesTb::selectImgFiles
    got fid:4873869, fname:\\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\workstations\HFDS2-10-1-0-99\c\WINDOWS\system32\drivers\\netwlan5.img fn: netwlan5.img to map in : FilesTb::selectImgFiles
    Doing a set next in : FilesTb::selectImgFiles
    About to get string 3 in : FilesTb::selectImgFiles
    File name: \\e1-stor\Backup Data\Backup Folder Archive (from e1-stor)\workstations\rwolfshagen\c\Resp-C4\ in : FilesTb::selectImgFiles
    getting int 1 in : FilesTb::selectImgFiles
    getting string 4 in : FilesTb::selectImgFiles
    I dumped a few things from last night’s Dr. Watson run, shown below, which may help:
    manifest.txt
    Server=watson.microsoft.com
    UI LCID=1033
    Flags=1672016
    Brand=WINDOWS
    TitleName=ImgHeaderLoader.exe
    DigPidRegPath=HKLM\Software\Microsoft\Windows NT\CurrentVersion\DigitalProductId
    ErrorText=This error occurred on 6/25/2009 at 1:47:02 AM.
    HeaderText=ImgHeaderLoader.exe encountered a problem and needed to close.
    Stage1URL=/StageOne/ImgHeaderLoader_exe/0_0_0_0/ntdll_dll/5_2_3790_4455/0002b67d.htm
    Stage2URL=/dw/stagetwo.asp?szAppName=ImgHeaderLoader.exe&szAppVer=0.0.0.0&szModName=ntdll.dll&szModVer=5.2.3790.4455&offset=0002b67d
    DataFiles=C:\DOCUME~1\ndana\LOCALS~1\Temp\1\WER141d.dir00\ImgHeaderLoader.exe.mdmp|C:\DOCUME~1\ndana\LOCALS~1\Temp\1\WER141d.dir00\appcompat.txt
    Heap=C:\DOCUME~1\ndana\LOCALS~1\Temp\1\WER141d.dir00\ImgHeaderLoader.exe.hdmp
    ErrorSubPath=ImgHeaderLoader.exe\0.0.0.0\ntdll.dll\5.2.3790.4455\0002b67d
    DirectoryDelete=C:\DOCUME~1\ndana\LOCALS~1\Temp\1\WER141d.dir00
    appcompat.txt
    <?xml version="1.0" encoding="UTF-16"?>
    <DATABASE>
    <EXE NAME="ImgHeaderLoader.exe" FILTER="GRABMI_FILTER_PRIVACY">
    <MATCHING_FILE NAME="common.dll" SIZE="6656" CHECKSUM="0xA0D33EDD" MODULE_TYPE="WIN32" PE_CHECKSUM="0x8ADC" LINKER_VERSION="0x0" LINK_DATE="06/25/2009 00:44:47" UPTO_LINK_DATE="06/25/2009 00:44:47" />
    <MATCHING_FILE NAME="FileLoader.exe" SIZE="65536" CHECKSUM="0x15C68C49" MODULE_TYPE="WIN32" PE_CHECKSUM="0x16CC5" LINKER_VERSION="0x0" LINK_DATE="06/23/2009 02:29:33" UPTO_LINK_DATE="06/23/2009 02:29:33" />
    <MATCHING_FILE NAME="FileLoaderOriginal.exe" SIZE="65536" CHECKSUM="0x6672AE23" MODULE_TYPE="WIN32" PE_CHECKSUM="0x17E45" LINKER_VERSION="0x0" LINK_DATE="06/20/2009 03:34:40" UPTO_LINK_DATE="06/20/2009 03:34:40" />
    <MATCHING_FILE NAME="ImgHeaderLoader.exe" SIZE="118784" CHECKSUM="0xBA94D6AE" MODULE_TYPE="WIN32" PE_CHECKSUM="0x20F4B" LINKER_VERSION="0x0" LINK_DATE="06/24/2009 22:42:49" UPTO_LINK_DATE="06/24/2009 22:42:49" />
    <MATCHING_FILE NAME="x.exe" SIZE="65536" CHECKSUM="0x66982AE3" MODULE_TYPE="WIN32" PE_CHECKSUM="0x103FD" LINKER_VERSION="0x0" LINK_DATE="06/18/2009 23:55:27" UPTO_LINK_DATE="06/18/2009 23:55:27" />
    </EXE>
    <EXE NAME="ntdll.dll" FILTER="GRABMI_FILTER_THISFILEONLY">
    <MATCHING_FILE NAME="ntdll.dll" SIZE="774144" CHECKSUM="0x74ACB78F" BIN_FILE_VERSION="5.2.3790.4455" BIN_PRODUCT_VERSION="5.2.3790.4455" PRODUCT_VERSION="5.2.3790.4455" FILE_DESCRIPTION="NT Layer DLL" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft® Windows® Operating System" FILE_VERSION="5.2.3790.4455 (srv03_sp2_gdr.090203-1205)" ORIGINAL_FILENAME="ntdll.dll" INTERNAL_NAME="ntdll.dll" LEGAL_COPYRIGHT="© Microsoft Corporation. All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0xC2B9D" LINKER_VERSION="0x50002" UPTO_BIN_FILE_VERSION="5.2.3790.4455" UPTO_BIN_PRODUCT_VERSION="5.2.3790.4455" LINK_DATE="02/09/2009 11:02:56" UPTO_LINK_DATE="02/09/2009 11:02:56" VER_LANGUAGE="English (United States) [0x409]" />
    </EXE>
    <EXE NAME="kernel32.dll" FILTER="GRABMI_FILTER_THISFILEONLY">
    <MATCHING_FILE NAME="kernel32.dll" SIZE="1038336" CHECKSUM="0x7EFD9E0D" BIN_FILE_VERSION="5.2.3790.4480" BIN_PRODUCT_VERSION="5.2.3790.4480" PRODUCT_VERSION="5.2.3790.4480" FILE_DESCRIPTION="Windows NT BASE API Client DLL" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft® Windows® Operating System" FILE_VERSION="5.2.3790.4480 (srv03_sp2_gdr.090321-1244)" ORIGINAL_FILENAME="kernel32" INTERNAL_NAME="kernel32" LEGAL_COPYRIGHT="© Microsoft Corporation. All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x101B44" LINKER_VERSION="0x50002" UPTO_BIN_FILE_VERSION="5.2.3790.4480" UPTO_BIN_PRODUCT_VERSION="5.2.3790.4480" LINK_DATE="03/21/2009 17:08:26" UPTO_LINK_DATE="03/21/2009 17:08:26" VER_LANGUAGE="English (United States) [0x409]" />
    </EXE>
    </DATABASE>
    THANKS!!!!!

  • How compile OCCI Demo of Oracle 9i with gcc on Redhat Linux 9?

    How compile OCCI Demo of Oracle 9i with gcc on Redhat Linux 9?
    When I use gcc-3.22 compile,error:undefined reference to 'typeinfo for oracle:occi:SQLException'.
    Reputedly gcc-2.95 or gcc-2.96 is the official supported version , did you try it?
    Can you help me compile it successfully?
    Thank you!
    Alex Clark

    For details
    compile cmd:make -f demo_rdbms.mk occipool
    compile result:
    make -f /opt/oracle/product/9.2.0/rdbms/demo/demo_rdbms.mk buildocci
    EXE=occipoo
    l OBJS=occipool.o
    make[1]: Entering directory `/opt/oracle/product/9.2.0/rdbms/demo'
    /usr/bin/g++ -L/opt/oracle/product/9.2.0/lib/
    -L/opt/oracle/product/9.2.0/rdbms/
    lib/ -o occipool occipool.o -locci -lclntsh `cat
    /opt/oracle/product/9.2.0/lib
    /sysliblist` -ldl -lm
    occipool.o(.gcc_except_table+0xe8): undefined reference to `typeinfo for
    oracle:
    :occi::SQLException'
    occipool.o(.gnu.linkonce.t._ZN8occipoolC1Ev+0x18): In function
    `occipool::occipo
    ol[in-charge]()':
    : undefined reference to
    `oracle::occi::Environment::createEnvironment(oracle::o
    cci::Environment::Mode, void*, void* (*)(void*, unsigned), void* (*)(void*,
    void
    *, unsigned), void (*)(void*, void*))'
    occipool.o(.gnu.linkonce.t._ZN8occipoolD1Ev+0xf): In function
    `occipool::~occipo
    ol [in-charge]()':
    : undefined reference to
    `oracle::occi::Environment::terminateEnvironment(oracle
    ::occi::Environment*)'
    occipool.o(.gnu.linkonce.t._ZN8occipool6selectEv+0x355): In function
    `occipool::
    select()':
    : undefined reference to
    `oracle::occi::SQLException::SQLException[in-charge](or
    acle::occi::SQLException const&)'
    occipool.o(.gnu.linkonce.t._ZN8occipool6selectEv+0x395): In function
    `occipool::
    select()':
    : undefined reference to `oracle::occi::SQLException::getErrorCode() const'
    occipool.o(.gnu.linkonce.t._ZN8occipool6selectEv+0x3db): In function
    `occipool::
    select()':
    : undefined reference to `oracle::occi::SQLException::getMessage() const'
    occipool.o(.gnu.linkonce.t._ZN8occipool6selectEv+0x44f): In function
    `occipool::
    select()':
    : undefined reference to `oracle::occi::SQLException::~SQLException
    [in-charge]()'
    occipool.o(.gnu.linkonce.t._ZN8occipool6selectEv+0x466): In function
    `occipool::
    select()':
    : undefined reference to `oracle::occi::SQLException::~SQLException
    [in-charge]()'
    collect2: ld returned 1 exit status
    make[1]: *** [buildocci] Error 1
    make[1]: Leaving directory `/opt/oracle/product/9.2.0/rdbms/demo'
    make: *** [occipool] Error 2

Maybe you are looking for

  • How to unblock my ipod touch? Anyone?

    Hay, I have a ipod touch that is blocked because my little brother pressed a wrong access code to many times. i have tried to connect it with iTunes but then it says that i have to fill in the access code on the ipod first. But that's not possible. D

  • Remove specific row and column from 2d array

    Hi, I would like to know how to remove the specific row and column from 2d array. for example, I have the original 4x4 array as below 2 -1 -1 0 -1 2 0 -1 -1 -1 2 0 -1 -1 -1 3 let say that i want to remove row 2(bold) and column 2(bold), and the new 2

  • Incomplete import ???

    Hello, What would be standard method of importing your models? Probably, 1. Make an export of the model (Model -> Export to File) 2. Make an import of the model (Model -> Import from File) Assuming that this would keep your model intact........ Oops

  • CK 15W - bad audio quality

    Hi, I just got a brand new CK 15W car kit. I've installed myself (not too much trouble as my car had another older nokia carkit installed so it was just a matter of cable switching). I am using Nokia 6120 classic brand new phone. After 2 days in use,

  • IPhone 4 and update 4.0.1

    On Friday I did the update out on the 4. It evidently crashed my phone. Tech support could not figure out how to get it working again. It only has the connect to iTunes screen. I am all fine with things having quirks, but when I have had my phone for