Creating a "pluggable" database backend

James Rich <[email protected]> Wed, 29 May 2002 17:40:18 -0600 (MDT)
Newsgroups gmane.comp.systems.as400.open-source
Message-ID <[email protected]>
Hey folks,
	I have a project that I'm working on.  I'm creating some
maintainance programs that can have any front end (so far I've just got a
gtk front end) and any database for a back end (so far I've only got
mysql).  What I want to get to is either a compile time config option or a
run time thing that will allow the back end to be selected (maybe a
./configure --enable-db2 for compile time or myprogram --backend=odbc for
run time).  So I need to have generic read, write, and update code which
then hooks to specific code for the type of backend.

	I want to be able to have the same application use a linux box or
an iSeries for data storage.  I want to use RPG-like file access (meaning
a function that does a read, one that does write, and one that does
update).  I'm trying to simulate externally described fields by using a C
header file that contains the fields names in a struct.

	So my questions are these:
1.  Has anyone tried something like this (using different backends in the
same app)?
2.  Is ODBC the only way to have a linux computer communicate with the
iSeries DB?
3.  Should I just use ODBC for all the database functions and forget
database-specific code?
4.  Are there reasons not to use ODBC (there must be, otherwise why do
people write database apps is something other than ODBC)?
5.  Are there license issues using IBM linux ODBC driver with GPL programs
(I don't know of any)?

I'll post the code if that helps.  You have to have gtk2 installed to
compile it.

James Rich
[email protected]

_______________________________________________
This is the Open Source Software for the AS400/iSeries (OSS400) mailing list
To post a message email: OSS400-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/oss400
or email: OSS400-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/oss400.