OCCI ResultSet problems

Hi!
My problem is the same as this thread.
OCCI programming
I call the method getColumnListMetaData and the method returns a STL vector with
Metadata objects and it works fine. My problem is when the vector should be deallocated.
When I run the testprogram a get this error message:
*** glibc detected *** double free or corruption (!prev): 0x08121568 ***
The sample code....
vector<MetaData> md = rs->getColumnListMetaData();
//column names to number mapping
map<string, int> columns;
for (int i = 0; i < md.size(); i++)
     columns[md[ i ].getString(MetaData::ATTR_NAME)] = i;
My versions:
CentOS release 4.2 (Final)
Kernel 2.6.9-34.EL
gcc version 3.4.4
OCCI 10g Release 2 (10.2)

Code:
int test(int argc, char **argv)
     const string userName = ".........";
     const string password = "....";
     const string connectString = "..";
     Environment *env = Environment::createEnvironment();
          Connection *conn = env->createConnection(
               userName, password, connectString);
          Statement *stmt = conn->createStatement(
               "SELECT * FROM TEST_TABLE");
          ResultSet *rs = stmt->executeQuery();
          vector<MetaData> md = rs->getColumnListMetaData();
          //column names to number mapping
          map<string, int> columns;
          for (int i = 0; i < md.size(); i++)
               columns[md[ i ].getString(MetaData::ATTR_NAME)] = i;
cout << "Column name: " << md[0].getString(MetaData::ATTR_NAME) << endl;
          stmt->closeResultSet(rs);
          conn->terminateStatement(stmt);
          env->terminateConnection(conn);
Environment::terminateEnvironment(env);
return 0;
Output:
Column name: ID
*** glibc detected *** double free or corruption (!prev): 0x08c52568 ***
Aborted

Similar Messages

  • OCCI -getString problem

    I'm having trouble executing code using the OCCI libraries.  I suspect that it's an issue with the version of OCCI that I'm using but can't seem to resolve the problem myself.
    On Windows 7, I'm using the OCCI libraries from the Oracle Express 11.2 32 bit install.  I'm compiling in Eclipse Luna (for 32 bit) 1a using the CDT plugin.  I'm using the compiler from Microsoft Visual Studio 12.0.
    I'm using the oraocci.lib. (If I use the oraocci11d.lib, my code crashes just trying to make a database connection.)  My current problem is with the oracle::occi::ResultSet::getString method.  If I call it once on my ResultSet, it works fine.  The second call causes my program to crash.
    Here is my code:
    std::sqlStr;
    sqlStr = "SELECT START, END, BATCH_ID, AGENT_ID FROM AGENTS WHERE ID = :1";
    connection code, stmt creation, etc
    oracle::occi::ResultSet *rs = stmt->executeQuery();
    if (rs->next()
       double start = rs->getDouble(1);
       double end = rs->getDouble(2);
       std::string batch = rs->getString(3);
       std::string agent = rs->getString(4);  // CRASH!
    Here is the exception that I get when I try to debug:
    "Unhandled exception at 0x00D82CB8 in DARTester.exe: 0xC0000005: Access violation reading location 0x0000005."
    Any help would be greatly appreciated.

    It is my fault. I use Fedore Core 4 and gcc4.0. By default it linking with libstdc++.6.so, but when I linkint direct with libstdc++.5.so it OK.
    Thank you for support!

  • OCCI ResultSet- getString Linux problem

    Hello,
    On forum I found how the solve problem for OCCI programm witch using MSVC++. May be anybody known how to correct compile and linking OCCI demo on Linux? The demos crashed at ResultSet->getString().

    It is my fault. I use Fedore Core 4 and gcc4.0. By default it linking with libstdc++.6.so, but when I linkint direct with libstdc++.5.so it OK.
    Thank you for support!

  • Select Max and ResultSet Problem With Access

    The following code is producing a 'null pointer excepetion' error and I know why it is occurring I just do not know how to fix the problem.
    Basically I want to automitically generate a unique ID that is one number higher than the max ID (data is stored within an Access database). The ID field is made up of first and last initial taken from parsing previous login info ('JS-01', 'JS-02', ect.). If there are no IDs in the database that match your login info I want to set the new ID equal to 'JS-01' if your login is 'James Smith' for example.
    The problem is explained within the code below.
    <%
    //define resultset and statement
    ResultSet rss=null;
    ResultSet rs=null;
    Statement stmt=null;
    //HERE IS WHERE YOU PARSE THE LOGIN INFO
    String finitial = (String)session.getAttribute("vfirst");//vfirst=JIM
    String linitial = (String)session.getAttribute("vlast");//vlast=SMITH
    char f = finitial.charAt(0);
    char n = linitial.charAt(0);
    String sID = f+""+n;//NOW sID CONTAINS 'JS'
    try {
    //Using the current database connection create a statement
    stmt=con.createStatement();
    //QUERY TO SELECT MAX ID
    //NOTE: CURRENTLY THERE ARE NO IDs LIKE 'JS' IN THE DATABASE !!!!!!
    String sql="SELECT Max(ID) As MaxID FROM tblError Where ID LIKE '%"+sID+"%'" ;
    rs = stmt.executeQuery(sql);
    String newID;
    //HERE THE RESULT SET SHOULD BE NULL BUT IT IS NOT. I KNOW THIS BECAUSE WHEN I REPLACE String iID WITH A LITERAL LIKE 'JS-03' THE LOGIC WILL EXECUTE CORRECTLY AND GIVE ME 'JS-04'. IF I LEAVE THE CODE LIKE IT IS THEN I GET THE NULL POINTER VALUE ERROR BECAUSE YOU CANNOT RESOLVE "MaxID" WHEN THE RESULT SET IS NULL. IF THE RESULT SET IS NULL IT SHOULD NOT EVEN EXECUTE ANY OF THIS CODE WITHIN THE 'if' STATEMENT, BUT IT IS. SO BASICALLY JSP IS LEAVING ME WITH A MAJOR OXYMORON AND I WOULD APPRECIATE ANY ADVICE THAT WOULD HELP ME SOLVE THIS PROBLEM.
    if(rs.next()){
    String iID = rs.getString("MaxID");
    String letters = iID.substring(0,3);
    int numbers = Integer.parseInt(iID.substring(3,5));
    numbers = numbers + 1;
    if(numbers < 10){
    newID = letters + "0" + numbers;}
    else{
    newID = letters + numbers;
    else{//IF THERE IS NO RESULT SET THAN THE ID SHOULD BE 'JS-01'
    newID = sID + "-01";
    %>
    Because this an Access database I cannot use any null exception functions such as NVL or COALESCE which are specific to Oracle and SQL Server I beleive.

    The max() will return a result set, even if the max value is null.
    You should check to see if iID is null.
    if(rs.next())
       String iID = rs.getString("MaxID");
       if (iID == null)
           newID = sID + "-01";
       else
          String letters = iID.substring(0,3);
          ... etc ...
    }

  • Array of ResultSets Problem

    hi ,
    esub[i] is an array of scrollable resultsets . where "i" is a premitive integer. When i remove the scrollable and updatable from the corresponding statement object the NullPointerException has gone . But later i need to compare the Resultsets among themselves , for which i need them to be scrollable .
    One more problem is , can i give like this ,
    for(;condition till the whole of array ;)
    while(esub.next()){
    // do something ..
    while(esub[j].next()){
    // do something ...
    esub[j].first();
    esub[i].first();
    please tell me if u understood .I tried this way , but the second while loop i.e, while(esub[j].next()){ // do something } is not getting executed .Why ? Is there any other way of doing it .

    import java.sql.*;
    import java.io.*;
    public class Gra
    Gra(){ }
    public float inputexp(){
                   float exp =0 ;
                   System.out.flush();
         try {
                   BufferedReader bin;
                   bin = new BufferedReader(new InputStreamReader(System.in));
                   exp = Float.parseFloat(bin.readLine().trim());
              } catch(IOException ex) {
                   System.out.println("Caught java.io.IOException:");
                   System.out.println(ex.getMessage());
    return exp;
    public String inputname(){
         String name=null;
              System.out.flush();
         try {
                   BufferedReader bin;
                   bin = new BufferedReader(new InputStreamReader(System.in));
                   name = bin.readLine().trim();
              } catch(IOException ex) {
                   System.out.println("Caught java.io.IOException:");
                   System.out.println(ex.getMessage());
    return name;
    public static void main(String args[]){
    Gra summary = new Gra();
              String url = "jdbc:oracle:thin:@localhost:1521:ORCL";
         Connection con = null;
              try {
              Class.forName("oracle.jdbc.driver.OracleDriver");
              con = DriverManager.getConnection(url,"chandu","chandu");
    System.out.println("Please Enter the Experiment name to compare the subexperiment results ");
    PreparedStatement forsubno = con.prepareStatement("select id,number_of_subexperiments from experiment where name = ? ");
    Statement stmt = con.createStatement();
    Statement sub = con.createStatement();
    Statement explevel = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    forsubno.setString(1,summary.inputname());
    ResultSet expsubinfo = forsubno.executeQuery();
    expsubinfo.next();
    int subnum = expsubinfo.getInt(2);
    String expid = expsubinfo.getString(1);
    int [][] mat = new int [subnum] [subnum];
    ResultSet [] esub = new ResultSet[subnum];
    int i=0;
    ResultSet subid = sub.executeQuery("select id from subexperiment where experiment_id = '"+ expid+"'");
    System.out.println("Enter the lower expression level ----->");
    float low = summary.inputexp();
    System.out.println("Enter the upper expression level ----->");
    float upper = summary.inputexp();
    * Dynamic Resultsets according to the number of the subexperiments present in the given Experiment
    while(subid.next()){
    System.out.println(i);
    System.out.println(subid.getString(1));
    esub[i++] = explevel.executeQuery("select spot_id,expression_level from spotmeasurement where expression_level between "+ low + "and "+ upper + " and subexperiment_id = '" + subid.getString(1) + "'");
    ResultSet rm,rn,rmg,rng;
    * Comparing the Resultsets esub[] among themself for the number of same expressed genes present in common
    for(int m=0;m<subnum;m++){
         for(int n=0;n<subnum;n++){
    if(m!=n){
              while(esub[m].next()){   
    // System.out.println(esub[m].getString(1));
                                                      rm = stmt.executeQuery("select probe_id from spot where id ='"+esub[m].getString(1)+"'");
                                            rm.next();
                        rmg = stmt.executeQuery("select gene_id from geneasprobe where probe_id='"+rm.getString(1)+"'");
                                       rmg.next();
                                                      System.out.println(n);
                                            while(esub[n].next()){ 
         System.out.println(esub[n].getString(1));
                                                 rn = stmt.executeQuery("select probe_id from spot where id ='"+esub[n].getString(1)+"'");
                                                           rn.next();
                                                      rng = stmt.executeQuery("select gene_id from geneasprobe where probe_id='"+rn.getString(1)+"'");
                                                           rng.next();
    if(rmg.getString(1).equals(rng.getString(1))){
                                                                          mat[m][n]=mat[m][n]+1;
                                                                } //end of if
    } //end of inner while
    esub[n].beforeFirst();
                                       } //end of while
                                       esub[m].beforeFirst();
              } //end of if
         } //end of for
    } //end of for
    /** this is for the disply of the result */
    for(int m=0;m<subnum;m++){
    for(int n=0;n<subnum;n++){
              System.out.println(mat[m][n]+"\t");
              System.out.println("\n");
    con.close();
    catch(Exception ex){
                        StringWriter stringWriter = new StringWriter();
                        PrintWriter printWriter = new PrintWriter(stringWriter);
                        ex.printStackTrace(printWriter);
                        StringBuffer error = stringWriter.getBuffer();
                        printWriter.close();
                        System.err.print("Exception:"+ex );
                        System.err.println(ex.getMessage());
                        System.out.println("TRACE = " + error.toString());
    } // end of main
    }// end of Class Gra
    this compiles with out any errors but when executed throws an exception . the error reads as
    Exception:java.lang.NullPointerExceptionnull
    TRACE = java.lang.NullPointerException
    at oracle.jadbc.draver.UpdatableResultSet.next(UpdatableResultSet.java:249)
    at Gra.main(Gra.java:103)
    Can you please tell me whats wrong , If as you say this design is wrong the please suggest me your idea so that let me learn and correct boss.

  • JDBC Resultset Problem with ORACLE 10.1.0.2

    Hello
    I have a problem with Petstore GenericCatalogDAO. java. The problem is the behaviour of the resultset object when retrieving data from the database.Below are two synareos one that
    works (when) hard coded and one that does not work when parameter values passed into the the result set.
    1. The code the WORKS.
    statement = connection.prepareStatement("select name from employee where a.name ='SMITH' order by name"
    ,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    resultSet = statement.executeQuery();
    resultSet.absolute(1);
    String s = resultSet.getString(1);
    The code that gives me a 'exhausted resultset' error which I think means no results
    String[] parameterValues = new String[] { "SMITH" };
    statement = connection.prepareStatement("select name from employee where a.name =? order by name ",
    ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    for (int i = 0; i < parameterValues.length; i++) {
    statement.setString(i + 1, parameterValues);
    resultSet = statement.executeQuery();
    resultSet.absolute(1);
    String s = resultSet.getString(1);
    There is obviously a problem using these named parametevalues with these preparedstatement resultset, Does anybody know anything about this and a fix for it????
    Cheers. Roger

    Roger,
    It's probably a mistake you made when posting your code, but your query string is incorrect it should be either:
    select name from employee where name = 'SMITH' order by nameor
    select a.name from employee a where a.name = 'SMITH' order by a.nameIn other words you have prefixed a column with a table alias but have not indicated a table alias in the query.
    Also, shouldn't your code be:
    for (int i = 0; i < parameterValues.length; i++) {
        statement.setString(i + 1, parameterValues[ i ]);
    }Or was the "[ i ]" part giving you trouble? (Since "[ i ]" -- without the spaces -- is treated as a text-formatting tag.)
    While I didn't try your specific query, I have no problem using "PreparedStatment"s with parameters.
    What is your environment? Mine is:
    Oracle 10g (10.1.0.4) database on Linux (Red Hat)
    JDK 1.4.2
    ojdbc14.jar JDBC driver (latest version)
    Good Luck,
    Avi.

  • JDBC MS SQL Server ResultSet Problem

    I'm writing a web-app using apache tomcat. I'm using MS SQL Server 2000 as my database. I am having no problem connecting to the database, but whenever I query the database, the ResultSet that is returned never has anything in it. I've tried even the simplest select queries and i'm still getting no results. I thought it might be a problem with the JDBC Driver I've been using, but I'm using the exact same driver for SQL Squirrel Client to connect, and Squirrel Client is returning results just fine from the database. Is there something that I've forgotten in my servlet code? Here's something like what I've been using:
    Connection con = DriverManager.getConnection(host, userName, password);
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("select * from some_table");

    If the select statement returns rows then the loop will execute... Put in some debugging output just before the while() loop, inside the loop, and immediately after the loop.
    Are you ignoring exceptions?
    Google for "jdbc tutorial". Take the simplest example program there that selects something. Run it as a command line program. Does it work? (Answer: yes.) Now what is different between that example program and your code?

  • OCCI Link Problem

    Hi,
    I am using Oracle 9.2.0.1.0, Redhat 9, gcc 2.96, glibc 2.3.2-11.9. I continually receive the following link problem:
    /usr/bin/ld: warning: libclntsh.so, needed by /opt/ora9/product/9.2//lib/libvdc.so, not found (try using -rpath or -rpath-link)
    /opt/ora9/product/9.2//lib/libocci9.a(occiUtil.o)(.text+0x99f): In function `oracle::occi::toUpperCase(basic_string&lt;char, string_char_traits&lt;char&gt;, __default_alloc_template&lt;true, 0&gt; &gt; const &)':
    : undefined reference to `__ctype_toupper'
    collect2: ld returned 1 exit status
    Can anyone assist in resolving this issue?
    Thanks
    JD

    Removed libocci9 and it compiled.
    JD

  • Jdbc resultset problem

    Hi all
    i'm gtting a problem with the action listener event of my "Next" and "Previous" Jbuttons. The code that i have written makes the program search only for the next record and not further...and sameproblem for previous button.
    That is: If originally i'm on the 3rd record, when i press next it goes to 4th record and when i press next again nothing happens. The same applies to my previous event.
    Can anyone give me a hint on how to solve this problem?
    i post my code below:
    next.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt)
                        try{
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection con = DriverManager.getConnection("jdbc:mysql:///Super","root","");
    Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    s.execute("SELECT * FROM tblcustomer");
         ResultSet rs = s.getResultSet();
         rs.next();
              cus.setText(rs.getString(1));
              fname.setText(rs.getString(2));
              lname.setText(rs.getString(3));
              txtadd.setText(rs.getString(4));
              txtcity.setText(rs.getString(5));
              txtcountry.setText(rs.getString(6));
              catch (Exception e)
              JOptionPane.showMessageDialog(null,"No further record available!");
    });

    thanx for your help but i still can't access the second record
    here is my code below, have a look at it:
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    final Connection conn=DriverManager.getConnection("jdbc:mysql:///Super", "root","");
    previous.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt)
                        try
                             final Statement s= conn.createStatement();
                        s.execute("SELECT * FROM tblcustomer");
              ResultSet rs = s.getResultSet();
                        if (!rs.isFirst())
                        while ( rs.previous() ){
                        rs.relative(-1);
                        cus.setText(rs.getString("Customer_ID"));
                        fname.setText(rs.getString("First_Name"));
                        lname.setText(rs.getString("Last_Name"));
                        txtadd.setText(rs.getString("Address"));
                        txtcity.setText(rs.getString("City"));
                        txtcountry.setText(rs.getString("Country"));
                        catch (Exception e)
              JOptionPane.showMessageDialog(null,"No further record available!");
              );

  • OCCI link problem with gcc2.96 in Redhat7.2, Oracle9.0.1

    When I compiled and linked the occi program occidml.cpp with dynamic shared library, all was OK.
    But when occidml run, segmentation fault happened.
    I'v read a topic that we can build the program with static library to avoid segmentation fault.
    So, I recompiled the program and I used the following command to relink it.
    /usr/bin/g++ -L/ora9/lib/ -L/ora9/rdbms/lib/ -o occidml occi
    dml.o -lclntst9 -locci9 -ldl -lm
    But, a lots of errors happened:
    /ora9/lib//libocci9.a(occiAnyDataImpl.o): In function `oracle::occi::AnyDataImpl::s
    etNull(void)':
    occiAnyDataImpl.o(.text+0x2c2c): undefined reference to `OCIAnyDataConvert'
    /ora9/lib//libocci9.a(occiAnyDataImpl.o): In function `oracle::occi::AnyDataImpl::g
    etDate(void) const':
    occiAnyDataImpl.o(.text+0x2cba): undefined reference to `OCIAnyDataAttrGet'
    /ora9/lib//libocci9.a(occiAnyDataImpl.o): In function `oracle::occi::AnyDataImpl::s
    etBlob(oracle::occi::Blob const &)':
    occiAnyDataImpl.o(.text+0x2d83): undefined reference to `OCIAnyDataAttrSet'
    /ora9/lib//libocci9.a(occiAnyDataImpl.o): In function `oracle::occi::AnyDataImpl::s
    etClob(oracle::occi::Clob const &)':
    occiAnyDataImpl.o(.text+0x2e13): undefined reference to `OCIAnyDataAttrSet'
    /ora9/lib//libocci9.a(occiAnyDataImpl.o): In function `oracle::occi::AnyDataImpl::s
    etBfile(oracle::occi::Bfile const &)':
    occiAnyDataImpl.o(.text+0x2ea9): undefined reference to `OCIAnyDataAttrSet'
    /ora9/lib//libocci9.a(occiAnyDataImpl.o): In function `oracle::occi::AnyDataImpl::s
    etNumber(oracle::occi::Number const &)':
    occiAnyDataImpl.o(.text+0x2f4c): undefined reference to `OCIAnyDataAttrSet'
    /ora9/lib//libocci9.a(occiAnyDataImpl.o): In function `oracle::occi::AnyDataImpl::s
    etDate(oracle::occi::Date const &)':
    occiAnyDataImpl.o(.text+0x2ff3): undefined reference to `OCIAnyDataAttrSet'
    /ora9/lib//libocci9.a(occiAnyDataImpl.o)(.text+0x30b8): more undefined references t
    o `OCIAnyDataAttrSet' follow
    Who can help me ? Is the static library libocci9.a with any problem?

    I tried clicking on the link and nothing whatsoever happened. So I tried a control click and selected "Open Link in new window" and a new window opened, followed by the Utilities folder opening. I made a test.html file with the link in it, put it on my startup drive and it worked as expected, and ditto for putting it on a second internal drive. I then put it on my iDisk and navigated to it thru its web site address of
    http://homepage.mac.com/francines/testlinks.html
    and discovered that the two other "local" operation links (to launch ScriptEditor) both worked, but the open folder link no longer did, except by using control click and choosing either "Open link in new window" or new tab. A new Safari window or tab opens, then the Utilities folder opens.
    I then tried the page in Firefox, and it didn't work AT ALL, not even with new window or tab. I then tried Mozilla and Netscape. Same deal. The ancient Internet Explorer opened the Utilities folder inside a new browser window rather than the Finder. This might be a clue as to why the link doesn't work as expected, but unfortunately I don't know what it means.
    Francine

  • OCCI version problem

    Hi,
    I am having a version problem with 9i.
    How can i compile OCCI with 9i database installetion?
    Which library would i need?
    my server is a SOL-Sparc-64 machine
    and oracle database server is installed there versiion oracle 9i 32bit.
    I tried to compile but it gives me error like....
    Undefined first referenced
    symbol in file
    main /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/crt1.o
    __1cG__CrunKpure_error6F_v_ /data/Indranil/prasenjit/clientlib/libocci.so
    __1cDstdbC__RTTI__1nDstdMlength_error__ /data/Indranil/prasenjit/clientlib/libocci.so
    __1cDstdMout_of_range2T6M_v_ /data/Indranil/prasenjit/clientlib/libocci.so
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJallocator4Cc___2G6Mpkc_r1_ /data/Indranil/prasenjit/clientlib/libocci.so
    __1cG__CrunIex_alloc6FI_pv_ /data/Indranil/prasenjit/clientlib/libocci.so
    __1cG__CrunIex_throw6Fpvpkn0AQstatic_type_info_pF1_v_v_ /data/Indranil/prasenjit/clientlib/libocci.so
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJallocator4Cc___2G6Mrk1_r1_ /data/Indranil/prasenjit/clientlib/libocci.so
    __1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJallocator4Cc___2t6MpkcIrkn0C__v_ /data/Indranil/prasenjit/clientlib/libocci.so
    __1cH__rwstdRexcept_msg_string2t6MIE_v_ /data/Indranil/prasenjit/clientlib/libocci.so
    Please tell me how to do it.
    Edited by: user652233 on Oct 16, 2008 1:18 AM

    Hello,
    I am trying to compile my C++ code (using OCCI) on Sun Solaris 5.9 (SPARC64PLUS) environment.
    We have compiled and tested it on RHEL 5 Linux.
    The Oracle (10g R3) database is on RHEL 5 server while OCCI/C++ application would be running on Sun Solaris 5.9 server.
    Since we have no Oracle installation on the Sun Solaris 5.9 server, there are no OCCI related libraries on this server and hence we are not able to compile our C++ code on Sun Solaris 5.9
    Can someone help me on how/where to download OCCI libraries (compile time as well as run time) for Solaris 5.9 ? I could find only Windows and RHEL versions of OCCI libraries on the Oracle website.
    Also, how stable is OCCI on Solaris 5.9 ?
    Regards,

  • OCCI Link problem (Error LNK2019: unresolved external symbol) in VS2012

    Hi,
    I'm having a hard time with this. I'm trying to implement OCCI within my application. Error I'm getting is:
    Error     1     error LNK2019: unresolved external symbol "public: static class oracle::occi::Environment * __cdecl oracle::occi::Environment::createEnvironment(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum oracle::occi::Environment::Mode,void *,void * (__cdecl*)(void *,unsigned int),void * (__cdecl*)(void *,void *,unsigned int),void (__cdecl*)(void *,void *))" (?createEnvironment@Environment@occi@oracle@@SAPAV123@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0W4Mode@123@PAXP6APAX2I@ZP6APAX22I@ZP6AX22@Z@Z) referenced in function "private: bool __thiscall ServerDataLoader::getPreSuffixesFromDB(void)" (?getPreSuffixesFromDB@ServerDataLoader@@AAE_NXZ)     P:\code\VizTool\VizPortal\DwgDgnConverter\ServerDataLoader.obj     DwgDgnConverter
    Error     2     error LNK1120: 1 unresolved externals     P:\code\VizTool\VizPortal\Debug\DwgDgnConverter.exe     1     1     DwgDgnConverter
    Yes, it looks like linking problem,...but for me everything seems set-up.
    - Included header files (from instantclient-sdk-windows.x64-11.2.0.3.0.zip)
    - Included library path from OCCI download (11.2.0.3.0)
    - Added oraocci11d.lib in linker
    Please, what am I doing wrong?
    Millions of thanks for any kind of feedback ;-)

    Have you succeeded? I tried vs2012 and it passed compilation, but gave the run-time error of _crtisvalidheappointer. But the same code runs well with vs2010. I think Oracle needs to publish the new patch for vs2012                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • OCCI, VS2010 problem

    Hi everyone,
    well after a lot of trouble i still get the following error message: "The procedure jump point "OCILobGetOptions" was not found at DLL "oci.dll" "
    and in german: "Der Prozedureinsprungpunkt "OCILobGetOptions" wurde in der DLL "Oci.dll" nicht gefunden"
    The error occur after i start my aplication.
    i use:
    - 11g Client,
    - occivc10_11202_win32.zip
    - Visual Studio 2010
    - WinXP SP3
    i really hope that someone can help me!

    Thanks for the response...
    well the error occur after i compiled and linked the project and then start the aplication. Here ist the code i hope it will help:
    #include "Employees.h"
    using namespace oracle::occi;
    using namespace std;
    int main (void)
         Employees *pEmployees= new Employees();
         pEmployees->List();
         delete pEmployees;
         cout << "Enter um fortzufahren...";
         cin.get();
         return 0;
    Employees::Employees()
         user = "Test";
         passwd = "xxxx";
         db = "Server1:1521/Ora10";
         env = Environment::createEnvironment(Environment::DEFAULT);
         try
              con = env->createConnection(user, passwd, db);
         }catch (SQLException& ex){
              cout << ex.getMessage();     
              exit(EXIT_FAILURE);
    Employees::~Employees()
         env->terminateConnection(con);
         Environment::terminateEnvironment(env);
    void Employees::List()
         Statement *stmt = NULL;
         ResultSet *rs = NULL;
         string sql = "SELECT * FROM INFO";
         try
              stmt = con->createStatement(sql);
         }catch( SQLException& ex){
              cout << ex.getMessage();
         if (stmt)
              try
                   stmt->setPrefetchRowCount(32);
                   rs = stmt->executeQuery();
              }catch( SQLException& ex){
              cout << ex.getMessage();
              if(rs)
                   cout << "Ausgabe:" <<endl;
                   while (rs->next()){
                        cout << rs->getInt(1) << endl;
                   cout << endl;
                   stmt->closeResultSet(rs);
    }well i will try somethink tomorrow and hope that it will work :D

  • OCCI Compiling problem

    I am trying to complie a simple OCCI program with the latest Oracle 10g client(with full installation) and gcc 3.2.2-5 (Oracle says OCCI works with gcc 3.2) on a Red Hat 9 box, I got the following error message:
    undefined reference to `oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode, void*, void* (*(void*,unsigned), void* (*)(void*, void*, unsigned),void(*)(void*, void*))'
    undefined reference to`oracle::occi::Environment::terminateEnvironment(oracle::occi::Environment*)'
    Does anyone know how to solve it? This program works fine with VC++ 6.0 and it is OK to complie OCI program on the same Linux box.
    Thanks in advance!

    Never mind. I got it worked.
    The final commmand I used like this (myprogram is the executable file on linux):
    g++ -o myprogram -L $ORACLE_HOME/lib -L $ORACLE_HOME/rdbms/lib -locci -lclntsh myprogram.cpp
    I got the previous problem by missing "-locci". Right now I get a warning, /u01/app/oracle/product/10.1.0/client_1/lib/libclntsh.so: warning: remap_file_pages is not implemented and will always fail, although it does not affect my programm. Anyone know what does it mean?

  • OCCI setVector() Problem

    Hi
         I have written the following OCCI code to call two procedures
    1. add1_detail(val in number) which is acceptiing an number as input
    2. add_detail2(val in my_type) where my_type is a user defined type (a TABLE of NUMBER type)
    I am trying to call both the procedures from the same OCCI program (one at a time). The code is as follows
    1     #include <iostream>
    2     #include <vector>
    3     #include <occi.h>
    4     using namespace oracle::occi;
    5     using namespace std;
    6     int main()
    7     {
    8          Environment *env = Environment ::createEnvironment();
    9      cout << "Connecting to the database" << endl;
    10      Connection *conn = env->createConnection( "sanju", "sanju","10.116.64.146:1521/ORCL" );
    11      cout << "Environment and Connection created" << endl;
    12          //Statement *stmt = conn->createStatement("begin add1_detail(:1);end;");
    13          //stmt->setInt (1, 8000);
    14          //stmt->executeUpdate();
    15          OCCI_STD_NAMESPACE::vector<int> v1;
    16          v1.push_back(11);
    17          v1.push_back(22);
    18          v1.push_back(33);
    19          v1.push_back(44);
    20          OCCI_STD_NAMESPACE::string schemaName="sanju";
    21          OCCI_STD_NAMESPACE::string typeName="my_type";
    22          Statement *stmt =  conn->createStatement("begin add_detail2(:1);end;");
    23          setVector(stmt, 1, v1, "my_type");
    24          stmt->executeUpdate();
    25          conn->terminateStatement(stmt);
    26          env->terminateConnection(conn);
    27          Environment::terminateEnvironment(env);
    28          cout << "Environment and Connection terminated" << endl;
    29          return 0;
    30     }
    The problem is like this, When I am calling add1_detail() by enabiling lines 12, 13, 14, the program works fine. But when
    I try to call the second procedure by enabiling line 15 to 24 and sisabeling 12, 13, 14, the program is showing exception from line no 8 (ie Environment *env = Environment ::createEnvironment();)
    Strange!
    By using debug mode I came to know that the error is commong from file _ctype.c from the line number 6 below
    1     int (__cdecl isupper) (
    2 int c
    3 )
    4     {
    5     #ifdef _MT
    6     pthreadlocinfo ptloci = _getptd()->ptlocinfo;
    7
    8 if ( ptloci != __ptlocinfo )
    9 ptloci = __updatetlocinfo();
    10
    11 return __isupper_mt(ptloci, c);
    12     #else /* _MT */
    13 return isupper(c);
    14     #endif /* _MT */
    15     }
    can any one please help on this matter
    Regards
    Alok

    Hello,
    I am trying to compile my C++ code (using OCCI) on Sun Solaris 5.9 (SPARC64PLUS) environment.
    We have compiled and tested it on RHEL 5 Linux.
    The Oracle (10g R3) database is on RHEL 5 server while OCCI/C++ application would be running on Sun Solaris 5.9 server.
    Since we have no Oracle installation on the Sun Solaris 5.9 server, there are no OCCI related libraries on this server and hence we are not able to compile our C++ code on Sun Solaris 5.9
    Can someone help me on how/where to download OCCI libraries (compile time as well as run time) for Solaris 5.9 ? I could find only Windows and RHEL versions of OCCI libraries on the Oracle website.
    Also, how stable is OCCI on Solaris 5.9 ?
    Regards,

Maybe you are looking for

  • Can i share itunes with 3 ipods?

    I have 3 iPods and i would like to know how to use the sae itunes account for all 3.

  • Can I have multiple user settings for one user?

    In one user account I would like to save and access mutlipe users settings at the click of a button. Can this be done?

  • Cyan not printing on HP Officejet Pro 8500 Wireless -

    MyCyan is not printing after changing empty cartridge. I'm now on level 3 of tools - cleaning print head and the printer is just beeen setting doing nothing for 20 minutes. Any suggestions? GGY-Cincinnati This question was solved. View Solution.

  • Maintaing Tax Types in the Table CRMC_TAX_GROUP

    Hi All In order to download Materials from ECC to CRM2007 via Middleware, I need to maintain the Tax Groups in the Table CRMC_TAX_GROUP and then assignt the Tax Types to the ECC Tax Classifications. However, I am unable to add entries to the table CR

  • Final Cut Pro operators manual in SPANISH?

    I'm trying to located a PDF of the Final Cut Pro operators manuals (the document that comes packaged in the software) ideally for version 6, but I'll take 5 or 7 if I have to, but written in Spanish. Does anybody know where I can find such a document