Connection to Firebird

This document explains the specific aspects of connecting Cocoon to a Firebird database.
For a general explanation on database connections please refer to the official documentation.

Downloading the jdbc driver

The zip file containing the necessary jar(s) can be downloaded here.
Unzip the file firebirdsql-full.jar which is contained in the zip file you just downloaded either into $COCOON_HOME/web-inf/lib or $TOMCAT_HOME/common/lib/, depending on whether you want it to be accessible only for Cocoon or for all your Tomcat webapps. If for whatever reason you have to use firebirdsql.jar instead, you must add at least mini-concurrent.jar, mini-j2se.jar, and, if your JDK is pre-1.4, jaas.jar. All these files are included in the downloaded zip file as well.

Setting Web.xml

In the $Cocoon_Home/WEB-INF/ directory you will find the web.xml file. Open it and look for these rows:

 For IBM WebSphere: -->

Here you have to add the following line:

<!--  For Firebird:   --> 

Setting cocoon.xconf

Search for: <datasources> Add into this element these lines:

  <jdbc name="YourPoolName">
    <pool-controller min="5" max="10" />

Setting sitemap.xmap

When you want to use the connection you just call the jdbc name inside the pipeline like this:

<map:match pattern="YourPattern">
  <map:generate src="YourSourcePath"/>
  <map:transform type="sql">
    <map:parameter name="use-connection" value="YourPoolName"/>
  <map:transform type="xslt" src="YourXslStylesheetPath"/>
  <map:serialize type="YourSerializer"/>

Of course you have to adapt this sample to fill your need.

Comments from the readers:

Firebirdsql (last edited 2009-09-20 23:40:33 by localhost)