the elj projectOpen Source Eiffel Libraries and Applications(SmartEiffel and ISE Eiffel) |
ELJ database connectivityIntroduction
The ELJ database connectivity cluster (dbs) provides access to some popular open source
database management systems.
Contact InfoPeople who can help are:
PrerequisitesThe ELJ installation provides some client (or even engine) interfaces only for the Win32 version of the lib. Most of the required packages are already part of modern Linux distributions or much easier to obtain and install for Linux than for Windows. So, if you get a linkage error the most likely cause is that you don't have the required C lib available. Notes the on supported DBMS typesAlthough we have tried to provide a similar interface to all supported DBMSs, there are some differences whcih are worth to mention here. Berkeley DB
The precompiled library for the Berkeley DB is part of the Win32 distribution of ELJ, but
not of the Linux version, because it is already installed on most Linux systems.
FirebirdThe highest developed interface we have so far. Includes a table and a transaction class. PostgreSQLBasic implementation which includes a query and a database connection class. SQLiteBasic implementation which includes a query and a database connection class. Please note that even if the parser of SQLite accepts most Ansi SQL conforme statements, it does only implement a subset of what it accepts. Also, the attributes of an SQLite relation are always stored and retrieved as STRING (as for version 2.7.2) so the only field type the SQLite interface implementation provides is STRING. The core classesThe heart of the database connectivity lib consists of the following classes. Some of the are deferred and are implemented by descendents in a DBMS specific way. Database connections
Database connection objects are implementations of the deferred class ELJ_DATABASE. They
provide the basic connection line to a certain database. Most parameters of these connections
are controlled by an option string which lokks like: "option1 = 'value1' option2 = 'value2'"Which option / value pairs are used by a certain implementation can be found in the headers of the class texts. A database connection object ignores all options it does not know about, so you can (mis-)use these options also for application defined values. Data providersThe ELJ_DATA_PROVIDER is the deferred base for DBMS specific query and table classes. After activating a data provider, it can open multiple cursors to provide access to its content. Table style classesTable descendents of ELJ_DATA_PROVIDER are designed to provide access to a single relation. The relation is selected by choosing a name. It is most likely the easiest way to access data. Query style classesQuery descendents of ELJ_DATA_PROVIDER allow to execute SQL statements within the limits of the underlying DBMS, they are implemented as pass through callers which do not modify the given statements in any way. The can excute commands and create result sets. CursorsAs mentioned above, cursor are created by implementations of ELJ_DATA_PROVIDER to access data in the form of 'rows' or 'tuples'. A data provider creates its 'main' cursor while getting activated and only this cursor is allowed to perform data manipulation operations if these ops are supported by the implementation. Every other cursor is considered read only. RecordsEvery cursor has an associated record, which provides access to the attribute values of the row the cursor points to. The field objects a record manages are created automatically when a cursor gets activated. Data field classesIn nearly every case the attributes of a certain relation are typed and so we have several descendents of the base calss ELJ_DATA_FIELD. The appropriate type of class to create for a certain attribute is chosen automatically. The core classesMore Info
|
|
``.. in open source, software lives on if there are enough believers to keep it alive ..'' (WSJ - 20 Jul 2003) |
http://elj.sourceforge.net/docs/dbs
Dec 04, 2003, 00:26 UTC