Re: c program against databases

From: Mike Segel <mikey_at_segel.NOSPAM-.KING.OF.MYDOMAIN.-NOSPAM.com>
Date: 1997/03/14
Message-ID: <33299EC9.15AD_at_segel.NOSPAM-.KING.OF.MYDOMAIN.-NOSPAM.com>#1/1


Lan H. Tran wrote:
>
> hello,
> i would like to write a unix-based c program that would perform SELECT
> and INSERT against a database. i am very familiar with esql/c.
> however, i would like to productize this program and allow it to work
> with a variety of databases (Informix, Oracle, Sybase, DB2) on a variety
> of operating systems (variations of unix and NT, maybe).
>
> is the best way to write embedded sql c code (and recompile using
> esql/c, pro*c, etc...)? how standard is this? is there a good toolkit
> to help me out? is there a good book or website to learn more? how do
> app dev packages like IEF do it?
>
> it seems like i would have to buy alot of precompilers. for example, 4
> databases running on 5 platforms would require 20 (4 x 5) esql/c like
> compilers. is this true?
>
OH, this is not a simple answer.
First, if you follow good software engineering development techniques, you will issolate you code in to layers or levels. The GUI level would not consist of any DB calls, only presentation code. The Business Logic level would not deal with and DB calls, only the actual business logic.
The DB layer would contain the code to request data from the database and place it in to the appropriate internal structures. You would then have to determine which database and call the correct lower level function to get the data from the database.

Now, if you are looking at tools, you could probably buy an ODBC library and link that in to your code for the lower level calls.

You could look to other systems like NeXTStep/OpenStep which have Adaptors to Informix/Sybase/Oracle/ODBC built in. But then you are dealing with Objective C not C.

HTH
-Mike

-- 
#include <std_disclaimer.h>		/* Mike Segel (MS385) */
#include <No_Spam.h>
#ifdef OFFENDED_BY_CONTENT
The author takes no responsibility for this post. 
Any resemblence to a coherent  rational thought is purely coincidence.
-The Management.
#endif
Received on Fri Mar 14 1997 - 00:00:00 CET

Original text of this message