Looking for C++ objects for Relational database's (ref's too)

Looking for C++ objects for Relational database's (ref's too)

Post by Cameron Elli » Thu, 12 Mar 1992 12:50:57



I am looking to access a relational database using C++ objects, I'm
sure someone has done work here before, I would like to build upto
others work here.

Any information on ftp'able stuff or even suggestions on how you have
done this is appreciated.
If there is enough interest I will summarize and post.


 
 
 

Looking for C++ objects for Relational database's (ref's too)

Post by Steve Willia » Fri, 20 Mar 1992 23:14:16


: I am looking to access a relational database using C++ objects, I'm
: sure someone has done work here before, I would like to build upto
: others work here.
:
: Any information on ftp'able stuff or even suggestions on how you have
: done this is appreciated.
: If there is enough interest I will summarize and post.
:
:

I'll repeat to refresh news...
Subject: Re: Repost: Info wanted: the same interface to the different RDBMSs
Newsgroups: comp.databases

In comp.databases you write:

>I wrote a library 1.5 yrs ago that completely replaced Pro*C from
>Oracle for a project I was doing.  It was completely in C++ and
>provided all the data movement handling automatically.  Each table or
>view was an instance of the dbms class.  Tables were created
>automatically and any freeform SQL command could be executed.
>Our team found that my library was very easy to use and much more
>efficient than Pro*C (embedded SQL).  The interesting part is that I
>realized that the library could be ported to any SQL DBMS that had
>more or less standard embedded SQL.
>Example of all code to create and access a table:
>#include <dbms.h>
>TABLE empl("fname*2 char(20), lname* char(25), empno decimal(6), DOH date");
>// The *, *2 specifies to the library the optional primary key
>// components.  These are then removed from the def.
>// A C++ class is created with appropriate attributes and another
>// instance of the table handling class is initialized with meta-data
>// All done with one non-preprocess step I call "gleaning".  Another
>// module is created and just needs to be linked in.
>main()
>{
>...
>empl.login("sdw/blabla"); // only once for program
>empl.open();                          // only once for table, creates table if
>                                              // it doesn't exist, based on above
>empl.empno = idno;
>strcpy(empl.fname, "fred");
>strcpy(empl.lname, "jones");
>empl+; // or empl.add();
>empl.select("where lname=jones");  // automatically sorts by primary
>                                                               // key components unless trailed by ';'
>while (!empl.eof()) {
>            puts(empl.fname);
>            empl++; // or empl.next();
>}
>// Now a shorter example of looking something up
> // associative style, mult [] are handled
>printf("empno: %d\n", empl["jones"]["fred"].empno);
>Specific support for joins, temp results, replacements, locking,
>commit and rollback.
>etc.
>If someone has a better interface, let me know, but I was pretty proud
>of this design, which I implemented in about 3 weeks!!!

>and was unsuccessful in getting it legally freed :-(.
>I would however be amenable to recreating this if there is interest,
>and possibly creating a product.  This could be expedited if one or
>more people would give me dialup or Internet access to a system with
>Oracle or Sybase or Ingres, etc. to redevelop.
>If you are interested, please let me know, I will keep a list and if
>anything develops (:-)), I'll let you know.  Please note whether you
>are interested only in a free version (which might happen 50/50).
>Thanks
>sdw

--
Stephen D. Williams    SDW Systems (513) 496-5223 Pager (513) 439-5428 VMail

Source Distribution    By Horse: 10028 Village Tree Ct., Miamisburg, OH 45342
GNU Support            ICBM: 39 34N 85 15W