Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!dlogics!dsa From: dsa@dlogics.UUCP (David Angulo) Newsgroups: comp.lang.c++ Subject: Re: C++ interfaces to Relational Databses. Summary: cannot make generic SQL table class Keywords: C++, OOP, OODBMS. Message-ID: <253@dlogics.UUCP> Date: 6 Dec 89 17:38:35 GMT References: <6515@pbhyf.PacBell.COM> <1989Dec5.010812.3485@sjsumcs.sjsu.edu> Organization: Datalogics Inc., Chicago Lines: 43 In article <1989Dec5.010812.3485@sjsumcs.sjsu.edu>, horstman@sjsumcs.sjsu.edu (Cay Horstmann) writes: > In article <6515@pbhyf.PacBell.COM> mtc@PacBell.COM (Mitchell T. Christensen) writes: > > > > > > > > Hi there, > > > > We here at Pac*Bell are preparing to delve into Object Oriented > > production using c++. We have a problem though. I am unable to > > come up with a clean interface for c++ to our "standardized" DBMS > > Oracle. > > > > Is there anyone out there who has solved this problem? > > > I'd like to amend this query--does anyone know of some set of classes > implementing SQL? One could have a table class and overloaded operators > for the relational operations instead of the yucky SQL syntax. Somewhere > down the line they should map to embedded SQL queries. Is any such work > done anywhere? > You can't really have a set of classes to implement SQL because when you have an embedded SQL statement, you must include the table name and the column name. This is then precompiled into calls to some generic routines. You can (with Oracle) call the generic routines yourself but this is quite cumbersome and subject to change. What we did is to create a code generator that generates a class for each table (actually it generates quite a few things for each table: documentation, the SQL statements to create the table, and the code for the class, etc.). This code has methods for insert, update, fetch, etc. and contains the eSQL statements to do this. We then run the SQL preprocessor and take its outputted code (which it thinks is C) and run it through the C++ compiler. Hope this helps - email me if you want a sample output of the code. S i g h -- David S. Angulo (312) 266-3134 Datalogics Internet: dsa@dlogics.UUCP 441 W. Huron UUCP: ..!uunet!dlogics!dsa Chicago, Il. 60610 FAX: (312) 266-4473