Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: C++ Cross Platform development for Oracle/SQLServer/etc

Re: C++ Cross Platform development for Oracle/SQLServer/etc

From: Dan Jeffrey <djeffrey_at_ilog.com>
Date: Fri, 14 Jan 2000 13:01:51 -0800
Message-ID: <85o2rm$ge8$1@ffx2nh3.news.uu.net>


You might take look at my company's product, ILOG DBLink. It is a set of lightweight C++ libraries that provide access to relational and object-relational data. You can send and receive data directly to and from a database using SQL statements. You can code for portability across different RDBMS's or you can take advantage of the special functionality of a certain RDBMS. It is portable across operating systems (Windows, Linux, and most other UNIX) as well as database systems (we support the RDBMS's from most major vendors).

For more information, please contact me directly (mailto:djeffrey_at_ilog.com_no.spam.if.you.please) or visit our web site:

   http://www.ilog.com/products/dblink/

DBLink supports stored procedures. I took a quick look at the example programs that come with the library and turned up samples that invoke stored procedures in Oracle, Sybase, and Informix databases. Please let me know if you would like to see one of these files.

Below is a simple example that reads and prints records from a table named, ATABLE. Note that it is not specific to any one database system. With this program you can access any database system supported by DBLink (ODBC is one).

int main(int argc, char** argv)
{

   if ( argc != 3 ) {

      cout << "Usage: " << endl << "   " <<  argv[0];
      cout << " <RDBMS name> <connection string>" << endl;
      return(1);

}

   cout << "Connecting to : " << argv[1] << endl;    IldDbms* dbms = IldNewDbms(argv[1], argv[2]);    if (dbms->isErrorRaised()) {
      cout << dbms->getErrorMessage() << endl;
      delete dbms;
      return(1);

}

   cout << "Creating a request : " << endl;    IldRequest* request = dbms->getFreeRequest();    if ( dbms->isErrorRaised() ) {
      cout << dbms->getErrorMessage() << endl;
      delete dbms;
      return(1);

}

   // Data selection.
   const char* selectStr = "select * from ATABLE";    cout << "Retrieving all rows : " << selectStr << endl;    do {

      request->execute(selectStr) ;
} while (!request->isCompleted()) ;

   if ( request->isErrorRaised() ) {

      cout << request->getErrorMessage() << endl;
}

   else {

      // Print selected item names.
      cout << "\t ATABLE" << endl;
      IldPrintTuple(request, IldNames);
      IldPrintTuple(request, IldSeparators);
      // Print selected item values.
      while ( request->fetch().hasTuple() ||
              !request->isCompleted()        ) {
         if ( request->isCompleted() ) {
            IldPrintTuple(request);
         }
      }
      if ( request->isErrorRaised() ) {
         cout << request->getErrorMessage() << endl;
      }

}

   // Disconnect, and delete all associated objects    // (e.g., request).
   delete dbms;
   return 0;
}

On Mon, 10 Jan 2000 16:52:50 -0500, in comp.databases.oracle.misc "bob" <NoSpam_RSterling_at_bionetrix.com> wrote:

>I wanted some recommendations on what I could use to develop cross platform
>database development for C++.
>
>I am looking at ODBC (using either drivers from OpenLink or Intersolv), but
>I am looking for some good libraries/templates to make ODBC calls.  I have
>found something called freeodbc, but it doesn't seem to be quite ready.  I
>would rather not try to develop my own ODBC classes using the direct ODBC
>calls.  I need to use stored procedures calls.
>
>I have also looked at Rogue Wave's DBtools a bit.
>
>Any recommendations.
>
>Thanks,
>bob Sterling
>
>




Received on Fri Jan 14 2000 - 15:01:51 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US