DDaattaa AAcccceessss wwiitthh LLiinnuuxx

l o i b

b g

ODBC o

GNOME d

n

a

o B

Copyright Statement

© 2001 Adam Tauno Williams ([email protected])

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. You may obtain a copy of the GNU Free Documentation License from the by visiting their Web site or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Credits

The assistance of the following people was imperative to the completion of the presentation:

Nick Gorham of the unixODBC project Rodrigo Moya of the GNOME-DB project Vivien Malerba of the gASQL project Giancarlo Capella, author of dbreport

I was privileged to have e-mail exchanges with all of the above developers about various issues. They were consistently helpful, overlooking my ignorance, and were excellent representatives of the Open Source ethic of community.

Thanks also is in order to the local users' group http://www.kalamazoolinux.org

The Topic

There are a great variety of relational database systems available for Linux, both Open Source and proprietary. They range in features from the engineless SQLite, to the read-oriented MySQL, to the ACID compliant PostgreSQL, and to incredibly expensive Oracle, Informix, and DB2

Then there are LDAP servers, mail servers, syslog files, NNTP servers, XML files, delimited files, fixed-length files, text files, , etc...

All these databases, servers, and files represent one thing: data, the real reason we have computers in the first place. The need, not only to record, but to sort, calculate, report, correlate, and "mine", is the basis of Information Technology. But while there seems to be no shortage of information on the "data sources" available for the Linux platform, corresponding information about tools to use that data seems to me to be lacking. The Scope

This presentation is focused toward the Linux "power user", and attempts to provide a working understanding of the technologies and tools available for data access on the Linux platform. Hopefully, it has enough depth to be of interest to budding developers as well.

The focus is on data-source independent tools. Therefore, tools linked to a specific database (or other source such as an LDAP server) are not covered. Along that same line, ODBC and GDA which enable most such tools, are covered "in-depth". Since the topic is restricted to data access on the Linux platform it does not include multi-platform data access tools written in Java or using the JDBC technology. Java is a registered trademark of Sun Microsystems Inc.

MMeetthhooddss The overview

Application Application Application O

Bonobo A F

/

C

Gnome DB O

ODBC Driver B Manager Libgda A Native ODBC Driver Library

Text Any RDBMS NNTP Mail LDAP RDBMS File CORBA

Pros & Cons

Native Libraries Native Libraries Fastest Every DBMS has a different API. Fewest Dependencies Vendor may change API at will. Usually Portable Developer may need to deal with a lot of low-level issues. ODBC Uniform API ODBC App becomes quasi-independent Less efficient than native libraries of backend data store. Requires a driver/provider. Drivers available for non-relational Drivers/Providers vary in quality. data stores More dependencies

GNOME DB (GDA) GNOME DB (GDA) Objects and signals replace . Under active development Inherent scalability All disadvantages of ODBC Support for Batch Jobs All advantages of ODBC Terms

Manager l Both ODBC and GDA have an application and a . r library known as a manager that knows about available drivers / s e v m providers, and allows the definition of new data sources as well as e y s

n creating connections/instances with defined data sources. e o r c u Driver/Provider

a ODBC (drivers) and GDA (providers) accomplish d o d

r pretty much the same purpose. They match up the ODBC or GDA t n a n API with that of a given datasource. Each type of data source used i ,

s (PostgreSQL, Oracle, Text File) requires a driver/provider. t A p D e c

G DSN

Both ODBC and GDA use the concept of a DSN n d o (Data Source Name) thar corresponds to a defined data source. All n c a ,

s the connection parameters are defined via the manager and are loaded C

m when the application connects to a defined DSN. B r e D t

O

w e h t n o B

NNaattiivvee LLiibbrraarriieess Native Libraries

Native libraries are usually provided in a SDK by Application the producers of the database engine.

The libraries are linked to the application when it is compiled.

Due to the "direct" nature, native libraries are usually the fastest way to communicate with a database engine. Native An example is "libpq.so" to which PostgreSQL Library applications are linked, with a "-lpq" directive to the .

RDBMS

FreeTDS (http://www.freetds.org)

FreeTDS is an LGPL'd re-implementation of the Tabular Data Stream protocol (versions 4.2, 5.0, and 7.0) used by Microsoft SQL server and Sybase products.

FreeTDS is used as the basis of unixODBC and DBI drivers as well as a GDA provider. When you build FreeTDS, you can specify the default version of the protocol you wish to use. This depends upon the product to which you desire to connect. --with-tdsver={4.2, 4.6, 5.0, 7.0} This can be overridden at run time by using the TDSVER environment variable or the config file which permits you to specify the version used for a particular server. MDB Tools (http://mdbtools.sourceforge.net/)

MDB Tools is a collection of utilities for working with Jet 3 (Access '97) and Jet 4 (Access 2000, Access 2002) data- bases. In version 4, a small SQL engine for use with MDB files as well as an ODBC driver for unixODBC is included. The libraries are released under LGPL while the utilities are released under GPL.

Access, Jet 3, and Jet 4 are registered trademarks of Microsoft Corporation Inc.

OODDBBCC ODBC

Developed by the Microsoft corporation as a way for applications to access a variety of backend databases without source code modification “Maximum interoperability”

Based upon open standards X/OPEN ISO/IEC Has become a ubiquitous standard, even on SQL non-Microsoft platforms, as is included with most Linux distributions.

All the API translation, etc... is performed on the client making ODBC drivers platform specific.

unixODBC http://www.unixodbc.org

unixODBC is an implementation of ODBC for GNU Application platforms (Linux, FreeBSD, etc...) as well as (Sun, AIX, etc...).

unixODBC is distributed under the LGPL so that commercial solutions can be based upon it without license concerns. ODBC Driver Manager unixODBC is compatible with the ODBC 3.5 standard, ODBC Driver can perform ODBC 3 to ODBC2 translation, as well as Native UNICODE to ANSI translation. Library

Text NNTP File RDBMS Installing unixODBC

1. Download tar file from website. 2. Unpack tar file. tar -xzvf unixODBC-2.0.4.tgz 3. Configure. ./configure --prefix=/usr/local/odbc --with-qt-dir=/usr/lib/qt-2.2.0 Almost every 4. Compile. make current Linux 5. Install. make install distribution includes unix- 6. Add library to library path. echo "/usr/local/odbc/lib" >> /etc/ld.so.conf ODBC as a 7. Rebuild library index. /sbin/ldconfig package. /usr/local/odbc

bin lib include etc Config tools ODBC Driver Header System-wide and command Manager and Files Drivers and DSNs line ODBC Drivers. client.

ODBC Drivers

Included Drivers PostgreSQL: libodbcpsql.so A normal unixODBC driver consists of libodbcpsqlS.so two shared libraries, a driver library and a setup library. NNTP: libnn.so libodbcnnS.so Typically the setup library ends in a SQI/Flat File: libodbctxt.so capital "S". libodbctxtS.so

MiniSQL: libodbcmini.so Drivers not included: libodbcminiS.so Oracle: http://www.easysoft.org MySQL: http://www.unixODBC.org/myodbc.html Sybase: http://www.freetds.org M$-SQL: http://www.freetds.org Access: http://mdbtools.sourceforge.net Informix: http://www.ibm.com DB2: http://www.ibm.com unixODBC Libraries

All these libraries should build The SQP library is a light-weight lex/yacc when you install unixODBC. based SQL parser used by unixODBC to permit Library: libodbccr.so SQL access to non-SQL sources such as NNTP. Linked List Library: liblstcl.la SQI Library: libsqilc.la The SQI library is a light-weight SQL engine SQP Library: libsqlpc.la that uses text files as its data source; this is the Logging Library: libloglc.la "backend" to the ODBC TXT driver. Tree Library: libtrelc.la PostgreSQL Setup: libodbcpsqlS.so Much of unixODBC's functionality has been split MiniSQL Setup: libodbcminiS.so into separate libraries to facilitate code reuse in MySQL Setup: libodbcmyS.so ODBC drivers and allow the code to be "borrowed" NNTP Driver Setup: libodbcnnS.so by other projects. TXT Driver Setup: libodbctxtS.so Setup libraries are typically built for all known esoob Setup: libesoobS.so ODBC drivers, even if the driver is not included or oplodbc Setup: liboplodbcS.so cannot be built due to lack of a SDK. This allows FreeTDS Setup: libtdsS.so you to drop a driver in and "just start using it". Oracle Setup: liboraodbcS.so The setup libraries are often maintained by the TXT Driver: libodbctxt.so unixODBC project and not the driver developers. NNTP Driver: libnn.so

ODBCConfig

ODBCConfig provides an easy GUI environment for defining personal DSNs, or if you're root, installing ODBC drivers and defining System DSNs. You can also control tracing, statistics gathering, and connection pooling. The TXT(SQI) Driver

Provides ODBC/SQL access to comma delimited files.... However there are the following limitations: Slow on large files, no indexing No locking or concurrency mechanism Maximum string per column is 255 characters Only simple statements supported

The setup dialog lets you establish a directory containing delimited files. The names of these files will be the corresponding ODBC table names. You also use this dialog to establish the field delimiter.

The first row of the file must contain the field names: name,alias,address Homer,Happy Guy,635 Evergreen Terrace

The TXT(SQI) Driver

If you do not specify a directory in the setup dialog, the driver will use "$HOME/.odbctxt". If this directory does not exist, it will be created.

Since TXT files have no datatypes, all fields are interpreted as varchar(255). The application should handle turning the string values into various other Vpnusers::506:awilliam floppy:dx:a19t:aswtyinpteers,.britz www:x:48:awilliam,nobody console:x:11: utmp:x:16: Delimited text files can be created using the pppusers:x:230:awillSiaQm,Lbr i"tzcreate table" command. All datatypes popusers:x:231: slipusers:x:232: should be varchar(255). slocate:x:21: xfs:x:233: The TXT driver is structured in such a way that saned:x:517: squid:x:234: is should easily serve as the basis for other file sword:x:518: oriented ODBC sources such as XML or DBF. informix:x:519: The NNTP Driver

Provides ODBC/SQL access to Usenet.... !!! select summary, sender, expires, However there are the following limitations: subject, date, keywords, Peculiar behavior at times (YMMV) xref, host, path, Only simple SELECT distribution, references, body from comp.os.linux where subject like '%ssh%';

Usenet groups are represented as tables.

Sections of the message are assigned field names: summary, sender, expires, subject, date, keywords, xref, host, path, distribution, references, body.

Currently this driver has no support for ODBC catalog functions, so you can't determine what newsgroups are available.

ODBCConfig Stats

The ODBCConfig provides a "Stats" tab from which you can monitor the processes using ODBC, the number of connections, currently executing statements, etc.... Statistical Term Definitions

Environment e Structure used by an ODBC application to manage s

o : its basic information such as required ODBC version and including s h g t e

l

n connections. Acquired via a call similar to: i n d t

o SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &V_OD_Env) n a

a c s o h n l

l o

i f Connection

a Structure used by an ODBC application to represent t

o

a y

s a connection to a DSN. Contains both the state of the connection as well r b e e

p

e as pertinent parameters such as timeouts, etc.. Acquired via a call similar p t y o t

a

to: SQLAllocHandle(SQL_HANDLE_DBC, V_OD_Env, &V_OD_hdbc) r g r e n u i p o o f m

Statement s r Structure used by the ODBC application to submit e o n r

f commands to the backend, track state, and manage the results of a query. o a r i

t e e Allocated via a call similar to: a r p

c e

i SQLAllocHandle(SQL_HANDLE_STMT, V_OD_hdbc, &V_OD_hstmt) l h d p n T

p a

. a Descriptor

s s Structure used by the ODBC application to explore e e C l l the organization of the results of a query: number of columns, field d d B n n lengths, field types, etc... For programmers familiar with ESQL the D a a

O h h descriptor handle takes the place of allocating an SQLDA (descriptor area).

The PostgreSQL Driver

odbc.ini [KCC.MAIN] The unixODBC suite Description = PostgreSQL ships with a PostgreSQL Driver = PostgreSQL of its own. A driver, Trace = No also developed by the TraceFile = PostgreSQL project, is Database = kcc.main called psqlODBC. Servername = localhost UserName = Password = Port = 5432 Protocol = 6.4 ReadOnly = No odbcinst.ini RowVersioning = No [PostgreSQL] ShowSystemTables = No Description = ODBC for PostgreSQL ShowOidColumn = No Driver = /usr/lib/libodbcpsql.so FakeOidIndex = No Setup = /usr/lib/libodbcpsqlS.so ConnSettings = FileUsage = 1 The PostgreSQL Driver

The ODBC standard mandates several catalog related functions that are not supplied by PostgreSQL configuration. But equivalent functions can be created by loading a set of stored procedures into the template1 database and any existing databases: psql -d template1 -f odbc.sql

By loading these functions into the template1 database, they will automatically be included in any subsequently created databases. On RedHat 7.x the path of this file is: /usr/share/doc/postgresql-7.0.3/contrib/odbc/odbc.sql Users of PostgreSQL versions prior to 7.x should use the odbc-pre7 file to enable the extended catalog functions, and see the README file.

The MySQL Driver

odbcinst.ini The MySQL driver is maintained [MySQL] by the MyODBC Description = MyODBC MySQL Driver project, a division Driver = /usr/local/lib/libmyodbc.so of the MySQL Setup = /usr/lib/libodbcmyS.so project. FileUsage = 1

odbc.ini [Slash Installation 1] Description = MySQL Driver = MySQL Server = slash Port = Socket = Database = slash1

ODBC 3.5 compliant. Informix & unixODBC

The ODBC driver included odbcinst.ini with Informix Client Access or [Informix] the SDK does not “support” Description=Informix IDS 2000 being managed via unixODBC, Driver=/usr/local/informix/lib/cli/libifcli.so but if configured manually, it APILevel=1 works without complication. ConnectFunctions=YYY DriverODBCVer=03.00 Do not use spare whitespace in the configuration FileUsage=0 file entries. They will confuse the Informix driver. SQLLevel=1 odbc.ini smProcessPerConnect=Y [miecr] Driver=Informix Description=Primary Morrison Industries Database Server=BARNET All appropriate Informix environment variables must Database=miecr be defined for the Informix CLIENT_LOCALE=en_us.8859-1 ODBC driver to operate. DB_LOCALE=en_us.8859-1 TRANSLATIONDLL=/opt/informix/lib/esql/igo4a304.so

DB2 & unixODBC http://www.unixODBC.org/doc/db2.html

odbcinst.ini [DB2] The ODBC driver included Description = DB2 Driver with DB2 does not “support” Driver = /usr/IBMdb2/V6.1/lib/libdb2.so being managed via unixODBC, FileUsage = 1 but if configured manually it DontDLClose = 1 works without complication.

odbc.ini [sample] Description = Test to DB2 With the DB2 driver the DSN Driver = DB2 (defined in odbc.ini) must be the name of the database. All appropriate DB2 environment variables must be defined for the DB2 ODBC driver to operate. Oracle & unixODBC

Oracle does not provide an ODBC driver for any platform other than .

A commercial Oracle ODBC driver for various UNIX and UNIX like platforms is available at: http://www.easysoft.com/products/oracle

Microsoft Windows is a registered trademark of Microsoft Inc. Oracle is a registered trademark of Oracle Inc.

Access & unixODBC

Build the mdbtools package: ./configure --with-unixodbc --enable-sql make; make install to produce libmdbodbc.so, the unixODBC driver for Access '97, 2000, and 2002. /etc/odbcinst.ini [MSAccess] Driver = /usr/lib/libmdbodbc.so /etc/odbc.ini [Soontobecorrupt] Driver = MSAccess Database = /usr/pcnet/waitfiveminutes.mdb Description = Access file not corrupted yet Access '95 MDB files are not supported.

Access`95, '97, 2000, and 2002 are registered trademarks of Microsoft Corporation Inc. M$-SQL & unixODBC Sybase & unixODBC

/etc/freetds.conf The FreeTDS library looks for /etc/freetds.conf. This configuration file is very similar in structure to that of Samba, providing a section for definition [SunnyDale] of global defaults and separate host = bluescreen.ghena.com stanzas[ gfolorb eaal]ch data source. port = 1433 tds version = 4.2 tds version = 7.0 initial block size = 512 try domain logins = yes swap broken dates = no try server logins = no swap broken money = no nt domain = THRALLS

/etc/odbcinst.ini /etc/odbc.ini [TDS] [SunnyDale] Description = FreeTDS ODBC Driver Driver = TDS Driver = /usr/local/freetds/lib/libtdsodbc.so Description = Very Very Proprietary The FreeTDS website has links to several Trace = No projects that provide interoperability with Servername = bluescreen.ghena.com Sybase and MS-SQL. Database = Utumno

??? & unixODBC

Yard Driver, Native No. In progress. Yes. No. unixODBC Operational ? In progress. Yes. ? Driver

Setup No. In progress. Yes. No. Library

xBase Interbase Linter sqllite Driver, Native unixODBC No. Yes. Yes. No. Operational Driver No. Yes. Yes. No. Setup Library No. Yes. Yes. No. isql

isql is a command line tool useful for using ODBC data sources from a dumb terminal or command line environment as well as processing batch jobs (in conjunction with cron for example).

Options: -b Batch mode no prompting -d{x} Delimit columns with -w Wrap results in a HTML table. -v Be verbose. Syntax:

isql [DSN Name] [User Name] [Password] [Options]

It can be used in an interactive mode or by piping in SQL command to stdin, one statement per line.

The INI Files

odbcinst.ini / .odbcinst.ini odbc.ini / .odbc.ini

This file, in {prefix}/etc, contains This file, in {prefix}/etc, or the information about the installed corresponding file in the user's home ODBC drivers. directory, contains information about configured DSNs (Data Source Names). Access to this file should always be via libodbcinst library calls. A Access to this file should always be command line tool odbcinst is via libodbcinst library calls. A command provided to facilitate batch access to line tool odbcinst is provided to this file. facilitate batch access to this file. odbcinst odbcinst is a command line that facilitates the scripted loading and odbcinst -i -s -f template_file unloading of drivers and DSNs, for application installers, etc... [MyPostgresDB] Description = odbcinst example Driver = PostgreSQL odbcinst [Action] [Object] [Options] Trace = Yes TraceFile = sql.log Result code of zero on success. Database = adam Servername = localhost

Options Action Objects -f Name of Template -i Install (valid for Install) -d Driver -u Uninstall -n Driver name or DSN -s Data Source -q Query (valid for Uninstall) -v Do not be verbose

The DataManager

Allows you to browse ODBC data sources that support catalog functions, issue SQL sequences, view and save results, save and load SQL sequences, etc.... Open Office Data Sources

Within Open Office / Star Office, various types of data sources are available, including ODBC. The Open Office ODBC subsystem works with the unixODBC driver manager so long as the library location is included in ld.conf or LD_LIBRARY_PATH. For an RPM installation of unixODBC, no configuration should be required.

Open Office Data Sources

The user must assign a unique name to each data source.

The user can define new data sources under Tools - > Data Sources. Once the type ODBC has been selected, clicking the ellipses button will bring up a list of the data sources known to the unixODBC driver manager. Open Office Data Sources

Once a data source has been declared the user must define the common attributes such as user name, character set, etc...

Open Office Data Sources

If the unixODBC driver supports catalog operations, the various tables are enumerated. Access via Open Office can be enabled or disabled on a table by table basis within the data source definition. Open Office Data Sources

The data source dialog provides a full featured SQL editor for executing arbitrary queries.

The SQL statements can be saved relative to the data source and recalled later by name.

Open Office Data Sources

A GUI query builder is also provided for those less proficient in SQL.

Queries can be saved relative to the data source and recalled later by name. Other Applications

Many (mostly commercial) applications support ODBC StarOffice 5.0, 5.1a, 5.2, 6.0 (5.1 non-a has several database related issues) Open Office Applixware Most actively developed PHP applications GNOME Office(?) KDE Office GNOME applications that support -db. dbReport http://www.comm.cc/~gianx/dbreport/ Only recently, as Linux has entered the enterprise, have many Open Source developers awoken to the importance of unified data storage and access methods and the difference between real database engines and over-hyped toys such as MySQL. Projects like gnome-db aim to facilitate the rapid development of applications that provide these benefits.

ODBC Socket Server (http://odbc.sourceforge.net/index.html)

ODBC Socket Server is a multithreaded Win32 service for Microsoft Windows NT and 2000 that exposes proprietary ODBC data sources for XML queries via a TCP/IP port.

Clients are available for COM, Perl, PHP, Python, and C++.

Other developers have contributed clients Released for Apple Macintosh, Tcl/Tk, and java. under GPL. Example data sources include Microsoft SQL server, Microsoft Access, Borland data files, and any service where an ODBC driver is available for Win32 but no other platforms. GGNNOOMMEE--DDBB && GGDDAA

Living up to its name.....

GNOME is the GNU Network Object Model Environment. It is not a window manager or a desktop, but a solution. Or in the words of the supreme chancellor of : , an attempt to make UNIX not suck (and facilitate code re-use). Bonobo: Making UNIX not Suck!

Makes sense for OSS developers, yes? Bonobo: Named after an endangere Wd hat is a "component model"? species of very promiscuous monkeys. Components are bits of software that provide some "standard" functionality such as viewing a PDF file, an HTML page, or presenting the user with a version of mine sweeper. What makes such a piece of software a component is that it is designed in such a way that applications can include it in an arbitrary fashion.

A Bonobo control is a CORBA server wrapped in the GTK+ objectmodel.

The point of components is to increase code re-use. For example: If I'm writing an application that needs charts, I use the chart component instead of building yet-more-code to draw charts. If I do make a new component, it can save other developers time. On writing a Bonobo Control: http://linux.denhaag.org/bonobo_controls/bonobo-controls.html B B o o n n o o b b o o : : A A b b i i w w o o r r d d

i i n n

E E v v o o l l u u t t i i o o n n ) I ) P s s A L

Bonobo:Abiword in Gnumeric Bonobo:Abiword in Gnumeric e c g E c n ) i . . A M g

. A . a a A c t s D t s a C e e

D G ,

e e M s ( t U r r n N e G u n u ( o y t t e r p v ) c c a l i m ) e t r o e e d a b C c i o t

t N P I i ) i L . M

. U R . t

+ h c h c s G t e

K j u e c c e s

b o , r r T B r e r a e n O L

G n d o D w i i Q

r e & P a t A

A v e

S g I E a

e A v o a o c U r c r g i r D M

r e l P , G e E

E ( L S u t c p O i o e A p t r s N

r e H D A a M o ( M G d t

m G p a n ) u A p a n O D

O N u

B , s S L G

t ( R C n D N T N M ( e B O

L g X r D S C e

G A G

s v O X

i a n r

h n o e e

i o o D t t i F F

t a h h d A a A r e v O u i

O t T , m T g c i 2 a . f . a n . E - . n e o r o r o M

b e b n o C O h ( e o n t N e o n b O G b o

n B I CORBA: An RPC Method

CORBA : From http://www.gnome.org Common To make use of CORBA technology, applications must go Object through an ORB (Object Request Broker) library that Request implements the CORBA API. The ORB hides all the low Broker level communications that are necessary for sending requests to objects, receiving replies from them, and making object Architecture implementations accessible. To the application, invoking an operation on a distributed object acts the same as a local Think: Object Oriented RPCfunction call.

The GNOME ORB is ORBit (http://www.labs.redhat.com/orbit/).

CORBA is a multi-platform technology. ORBs and the CORBA API are available on every significant platform. This lends immense power and flexibility to the GNOME component architecture. CORBA & GNOME: http://developer.gnome.org/doc/guides/corba/html/book1.html

CORBA IDL

IDL Interface Description Language The CORBA IDL appears very similar to a C++ class definition, which is nearly what IDL is. IDL describes the methods and attributes of a CORBA object. IDL is programming language neutral; each language that supports CORBA provides an IDL compiler which builds the necessary files (for example: header files in C/C++) to build an application that will use an object.

module car { interface wrecker { attribute string color; oneway boolean crashed(); boolean who_crashed(out string first_name, out string last_name); }; }; OAF: Object Activation Framework (Now called -activation)

For those familiar with GNOME, OAF will replace Gnorba in GNOME 2.0. Gnorba is deprecatedB.asically, the job of OAF is to keep a database (comprised of an XML file for each available component) of components containing information about capacities, parameters, how to start them, etc.... in /usr/share/oaf. Files put in /usr/local/share/oaf by TGZ packages will never get seen.

Camel: Generic Messaging Library

CAMEL is an acronym for: Camel's CAMEL is the foundation of the mail service Acronym of the Ximian evolution groupware product. Makes Everyone Laugh

Based upon Sun's JavaMail API

Views all message repositories as stores containing folders which in turn contain messages.

Has a plugin architecture to allow additional protocols to be added without application changes.

Full support for IMAP, IMAP SEARCH, POP3, MIME, and virtual folders. libgda (GNU Data Access)

What is is? libgda is a collection of CORBA IDL interfaces that provides standardized access to a great variety of datasources.

It attempts to overcome the quasi-standardization of SQL and ODBC, and non-SQL datasources such as mail servers and directory services. History libgda was once part of the gnome-db project, Packages are provided but all dependencies upon GNOME have been for both RedHat and removed so that it can be used in the development Debian distributions. of non-GNOME and embedded applications.

Requires Released under GPL/LGPL ORBit, GConf, OAF and Glib.

gda Architecture

gda Application GNU Data The libgda client library Access Hides the complexities of CORBA and any name-spaces or object activation required by the platform. gda/libgda is actually completely independent CORBA of the GNOME UI.

GDA Provider Scalability: Clients can share a GDA provider or request a unique provider. The provider can run in a separate Data Store address space than both the application (ODBC, Native Library, etc..) and the actual data source. By allowing clients to share a data provider, you reduce the number of context switches on the host where the provider executes. gda Providers GDA also provides c S o

a "default" provider. o m m p e l Providers are not built by default, you must indicate at compile time what ones you want/need. p e t r e o

t Configure script parameters v h i d Root of package --prefix= a e n r

Location of ODBC Libraries --with-odbc= o s

t

Location of FreeTDS (M$-SQL) Libraries --with-freetds= a h r e

Location of MySQL Libraries --with-mysql= e r

s Location of PosteSQL libraries --with-postgres= m .

Location of Sybase libraries --with-sybase= o r

Location of LDAP libraries --with-ldap= e

s

Location of ORACLE libraries --with-oracle= t a

Location of Interbase libraries --with-interbase= b l Location of MDB libraries --with-mdb= e

a

Location of mail backend --with-camel= n d

Each provider has a Bonobo component to provide the GUI configuration interface to the GNOME DB front end.

The Default Provider

libgda includes a "default provider" that is always built with the package. SQLite - a SQL front end to GDBM This guarantees the user at least ONEthat provides a single user engine- operational provider. less database. Feature List of SQLite: http://www.hwaci.com/sw/sqlite/ Implements most of SQL92. A database is just a directory of GDBM files. Unlimited length records Import and export data from PostgreSQL. Very simple C/C++ interface (three functions and one opaque structure) A Tcl interface is included. Command-line access program sqlite uses the GNU Readline library. A Tcl-based test suite provides near 100% code coverage Approximately 9500 lines of C code No external dependencies other than GDBM Built and tested under Linux, HPUX, and WinNT. GNOME 1.4 **Shameless self promotion disclaimer** Take a look at the archived e-mail message found at: http://mail.gnome.org/archives/gnome-db-list/2001-April/msg00040.html Provider Status (As of 27May2002)

Operational in GNOME 2: The default provider for Mysql GNOME 2 GNOME-DB PostgreSQL is now an XML file. Porting to GNOME 2: Oracle Sybase ODBC Sqlite Under Development: MDB (Access)

The Interbase, LDAP, and mail (CAMEL based) providers are in need of developers.

GNOME DB

GNOME DB is a front end to the GDA data architecture, providing the ability to graphically configure providers, execute basic queries, etc...

GNOME DB provides a set of widgets and Bonobo components that are bound to GDA connections and can be re-used in applications. Widgets: The GUI tool provided by GnomeDbLogin GnomeDbLoginDlg GNOME DB is "gnomedb-fe", GnomeDbDsnConfigGnomeDbHelpViewer with which you can: GnomeDbBrowser GnomeDbGrid Configure provider connections, GnomeDbDataset GnomeDbCombo View a providers logs, GnomeDbList GnomeDbIconList Browse tables, views, stored GnomeDbReport GnomeDbDesigner procedure and data types, GnomeDbHelp GnomeDbShortcut Send commands to the provider GnomeDbWindow GnomeDbError and view results (SQL), and GnomeDbErrorDlg Manage "batch" jobs. Building Gnumeric with GDA Support

Unfortunately, Gnumeric does not ship with GDA or Bonobo support enabled. This is done to maximize stability of the general release.

Gnumeric's configure script has three options not enabled the standard build: --with-bonobo : which enables Bonobo controls --with-gda : which enables support of GDA providers --with-gb : which enables support of gb (GNOME Basic), a M$ Visual Basic compatible language for writing macros.

Notice from the 0.65 configure script: Please do not distribute prebuilt binaries with bonobo support. However, as of the 0.65 release we consider it stable enough to accept bug reports.

THIS SLIDE IS OBSELETE. Using GDA from Gnumeric

Access to GDA provides is via the execSQL function: =execSQL("gda_dsn", "username", "password", "select * from my_table")

Step-by-Step: 1. Select the region you wish to fill with data. 2. With the region selected, enter the execSQL function.* *Do NOT press . 3. PressCtrl-Shift-Enter* * Some versions of Gnome-db contains a bug where you may have to press Ctrl-Shift-Enter twice.

gASQL (http://gasql.sourceforge.net)

What is gASQL? - Probably, the sweetest data access tool available for Linux. - A GUI front end to GDA providers - A GUI query builder - Modify data via dynamically generated forms

Still under very heavy development

- Supports plugins to manage non-standard (BLOB, etc...) data types such as images, IP addresses, etc... - Relations between tables are defined graphically. gASQL: Tables & Views

The queries you create in gASQL and the relationships you define can be saved to an XML file via the "File" pull down menu. Save often.

The first gASQL you see after connecting to the database is "Tables & Views". From here you can see the entire content of a table or view, drop the table or view, or adjust its properties. Creating a table is not yet supported.

gASQL: Table Properties

The table's properties dialog lets you both see the exact structure of a table and add relationships to other tables. gASQL: Database Relations (schema)

As you define the relationships between tables, gASQL creates a graphical representation of the database. You can view or alter this diagram by clicking on the "Relations" icon found in the "Tables & Views" screen.

gASQL: Sequences

gASQL also allows you to view and destroy sequences for the data- bases that support them.

Currently, the "Create Sequence" button is not active. gASQL: Query Builder

gASQL also features a visual query builder. By simply selecting elements the user can build complex queries, gASQL uses the relationships defined between the tables to automatically tie everything together. A graphical representation is created as you add objects to the query.

gASQL: Query Builder

The query builder is quite powerful, not only can queries contain table fields but also - - Stored Procedures - Aggregate Functions - User Defined Functions - Fixed Values The query builder will include fields required to tie various tables together if the user does not manually add them to his or her query. These are referred to as "Automatic Dependencies". gASQL: Query Builder

To be certain gASQL has assembled to query correctly, the user can view the actual text of the SQL statement.

The "Options" tab contains order and group control for the query, but these are not implemented yet. The "Where clauses" tab lets you customize the order of each element in the where clause of the generated SQL.

gASQL: Form Builder

A query can contain one or more forms used to view and/or modify the contents of the database.

A form is created "inside" the query to which it belongs, and the user can select what operations the form is able to perform.

The "Edit Layout" function is not currently enabled. This feature will integrate gASQL with GLADE. gASQL: Forms

gASQL forms allow the user to easily modify the contents of a database table.

gASQL: Grids

The user can also view the contents of a query or an entire table, or view with the gASQL grid options.

Grids can also be used to add additional data to a table via dynamically generated forms. User defined forms may contain a grid button in order to bring up a grid view of the query. Currently, row deletion from a grid is not implemented. gASQL: Plugins

gASQL supports plugins for the visual representation of non-text datatypes such as images, network addresses, etc...

gASQL: Plugins

Any field or data type can be associated with a specific plugin. These plugins will then automatically be used in the visual display of the data. Links

On Writing a Bonobo Control: http://linux.denhaag.org/bonobo_controls/bonobo-controls.html GNOME & CORBA: http://developer.gnome.org/doc/guides/corba/html/book1.html The ORBit Home Page: http://www.labs.redhat.com/orbit/ The unixODBC Home Page: http://www.unixodbc.org/ The GNOME-DB Home Page: http://www.gnome-db.org/ Gnumeric Home Page: http://www.gnome.org/projects/gnumeric/ gASQL Home Page: http://gasql.sourceforge.net/