Installing and Configuring Firebird (Interbase) with Enhydra 

Background

Borland (Inprise) has made the source code of the Interbase RDBMS engine version 6.0 available as an "open-source" project. There, you can find binaries and source codes for this version of Interbase. Unfortunately, Borland has also decided to not release free binaries of next versions (7.0 and later) of Interbase. This is one of the main reasons which led to the creation of the Firebird project.


Installing Firebird (Interbase)

For Windows users, the easiest way to install Firebird or Interbase is to download a compiled installation script from the IBInstall site. You just have to run the installation program and follow the instructions. Other users should follow the instrutions found at the Firebird or Interbase site.


Installing InterClient (JDBC driver)

The Interbase JDBC driver, called InterClient, talks to an intermediary server (InterServer) that talks to the Firebird/Interbase server. All three processes (Firebird/Interbase server, InterServer and InterClient) can run on different computers. You can find the InterClient/InterServer software on the Open-source Interbase site. You should download the version corresponding to your JDK. Note that InterClient and InterServer versions should match to work correctly.

After installing the InterClient software, you must add the "interclient.jar" file to your system CLASSPATH.

If you are using JDK 1.3.x, you should replace the "interclient.jar" with a version compiled with JDK 1.3. See http://www.kpi.com.au/interbase/home.jsp for more information (java.lang.VerifyError).

Note : The 2.01 version of InterClient has been released by the Firebird project. This version should solve all problems relating to JDK 1.3. Download available in the Firebird directory of Sourceforge.


Configuring DODS

You should modify the Standard database parameters in the "dods.conf" file in this way :

       Database.OidDbType.Standard= "DECIMAL(9,0)"
       Database.VersionDbColumnName.Standard= "ObjectVersion"
       Database.DeleteCascade.Standard= true
       Database.StringQuoteCharacter.Standard= '
       Database.StringMatch.Standard= "LIKE"
       Database.StringWildcard.Standard= "%"
       Database.JDBCtype.BIT.Standard= "SMALLINT"
       Database.JDBCtype.TIME.Standard= "DATE"
       Database.JDBCtype.TIMESTAMP.Standard= "DATE"


Configuring your Enhydra applications

You should add the "interclient.jar" file to your application CLASSPATH in the corresponding "start.in" file under the "Build up classpath" section (see the "Getting Started with Enhydra" book for more information) :

       # Build up classpath.
       #
       CLASSPATH=/firebird/interclient/interclient.jar
       export CLASSPATH

Now you have to configure the database manager for your application in this way in the "application.conf.in" file ("simpleApp" being the name of your database) :

       #-------------------------------------------------------------
       # Database Manager Configuration
       #-------------------------------------------------------------
       DatabaseManager.Databases[] = "simpleApp"
       DatabaseManager.DefaultDatabase = "simpleApp"
       DatabaseManager.Debug = "false"
       DatabaseManager.VersionColumnName = "ObjectVersion"
       DatabaseManager.DB.simpleApp.ClassType = "Standard"
       DatabaseManager.DB.simpleApp.JdbcDriver =
             "interbase.interclient.Driver"
       DatabaseManager.DB.simpleApp.Connection.Url =
             "jdbc:interbase://loopback/d:/projets/dba/simpleapp.gdb"
       DatabaseManager.DB.simpleApp.Connection.User = "SYSDBA"
       DatabaseManager.DB.simpleApp.Connection.Password = "masterkey"
       DatabaseManager.DB.simpleApp.Connection.MaxPoolSize = 30
       DatabaseManager.DB.simpleApp.Connection.AllocationTimeout = 10000
       DatabaseManager.DB.simpleApp.Connection.Logging = "false"
       DatabaseManager.DB.simpleApp.ObjectId.CacheSize = 20
       DatabaseManager.DB.simpleApp.ObjectId.MinValue = 1

You can find more information on each parameter in the "Getting Started with Enhydra" book or in the "Configuring Enhydra to use Interbase" documentation.


JDBC logging engine

You can find a free tool to log all JDBC calls at Provision6. No code changes are required to existing applications.


Resources

Interbase.com
Open-source Interbase
Interbase Community
Interbase2000.org
Firebird
IBPhoenix.com
IBInstall
Interbase FAQ
InterClient.jar for JDK 1.3
Getting Started with Lutris Enhydra
Configuring Enhydra to use Interbase
Provision6