Example jdbc element and type-mapping entries for Interbase and Firebird DBMS

Table Of Contents

Firebird 1.0.2 and Jaybird 1.0

InterBase and Interclient 1.6.1

Firebird 1.0 and Interclient 2.0.1

 

Jaybird 1.0 and Firebird 1.0.2

Database Notes:

When installing Jaybird into the classpath, you do not need to install: mini-concurrent.jar, log4j-core.jar, and jaas.jar. All these are included with the Expresso distributions already. You MIGHT need mini-j2ee.jar depending on your application server.

Configuration File Mappings:

The following settings have been succesfully used with the Firebird Database and Jaybird 1.01 (with a Dialect 3 database). BLOB types are basically limited to 2 MB and under. We encountered OutOfMemory errors when we tried much larger files than that. Otherwise, the development team has been quite happy with the Jaybird driver.

	<context name="default">
<description>Default Database (InterBase)</description>
<hasSetupTables>true</hasSetupTables>
<jdbc driver="org.firebirdsql.jdbc.FBDriver" url="jdbc:firebirdsql://[machine name]/3050/:[path to gdb file]" connectFormat="1" login="sysdba" password="masterkey" cache="y" createTableIndicies="true" escapeHandler="com.jcorporate.expresso.core.db.DoubleQuoteEscapeHandler" />
<type-mapping>
<java-type>BIT</java-type>
<db-type>SMALLINT</db-type>
</type-mapping>
<type-mapping>
<java-type>LONG</java-type>
<db-type>INTEGER</db-type>
</type-mapping>
<type-mapping>
<java-type>BLOB</java-type>
<db-type>BLOB SUB_TYPE 0</db-type>
</type-mapping>
<type-mapping>
<java-type>CLOB</java-type>
<db-type>BLOB SUB_TYPE 1</db-type>
</type-mapping>
<images>%context%/%expresso-dir%/images</images>
<startJobHandler>y</startJobHandler>
<showStackTrace>y</showStackTrace>
<mailDebug>n</mailDebug>
</context>

Interclient 1.61

The login and passwords are just the defaults for the database.

You will want to merge this information in with the information already in Expresso's default expresso-config.xml file

<jdbc driver="interbase.interclient.Driver"
    url="jdbc:interbase://localhost/<PATH TO GDB FILE GOES HERE>"
    connectFormat="1"
    login="sysdba"
    password="masterkey"/>

<type-mapping>
   <expresso-type>text</expresso-type>
   <java-type>LONGVARCHAR</java-type>
   <db-type>varchar(4000)</db-type>
</type-mapping>

<type-mapping>
   <java-type>DATE</java-type>
   <db-type>DATE</db-type>
</type-mapping>

<type-mapping>
   <java-type>FLOAT</java-type>
   <db-type>DECIMAL</db-type>
</type-mapping>

<type-mapping>
   <java-type>BIGINT</java-type>
   <db-type>INTEGER</db-type>
</type-mapping>

<type-mapping>
   <java-type>NUMERIC</java-type>
   <db-type>NUMERIC</db-type>
</type-mapping>

<type-mapping>
   <java-type>BIT</java-type>
   <db-type>SMALLINT</db-type>
</type-mapping>

<type-mapping>
   <java-type>TIME</java-type>
   <db-type>TIMESTAMP</db-type>
</type-mapping>


Firebird 1.0 with Interclient 2.01

The following settings have been succesfully used with the Firebird Database and Interclient 2.01 (with a Dialect 3 database) At the time of this writing, we have been unable to get Firebird to work properly with BLOB datatypes. Updates to this will be provided as we are able to resolve this problem.

	<context name="default">
<description>Default Database (InterBase)</description>
<hasSetupTables>true</hasSetupTables>
<jdbc driver="interbase.interclient.Driver" url="jdbc:interbase://[machine name]/[path to gdb file]" connectFormat="1" login="sysdba" password="masterkey" cache="y" createTableIndicies="true"/>
<type-mapping>
<java-type>LONGVARCHAR</java-type>
<expresso-type>text</expresso-type>
<db-type>varchar(4000)</db-type>
</type-mapping>
<type-mapping>
<java-type>DATE</java-type>
<db-type>DATE</db-type>
</type-mapping>
<type-mapping>
<java-type>FLOAT</java-type>
<db-type>DECIMAL</db-type>
</type-mapping>
<type-mapping>
<java-type>BIGINT</java-type>
<db-type>INTEGER</db-type>
</type-mapping>
<type-mapping>
<java-type>NUMERIC</java-type>
<db-type>NUMERIC</db-type>
</type-mapping>
<type-mapping>
<java-type>BIT</java-type>
<db-type>SMALLINT</db-type>
</type-mapping>
<type-mapping>
<java-type>TIMESTAMP</java-type>
<db-type>TIMESTAMP</db-type>
</type-mapping>
<type-mapping>
<java-type>TIME</java-type>
<db-type>TIMESTAMP</db-type>
</type-mapping>
<type-mapping>
<java-type>TINYINT</java-type>
<db-type>SMALLINT</db-type>
</type-mapping>
<images>%context%/%expresso-dir%/images</images>
<startJobHandler>y</startJobHandler>
<showStackTrace>y</showStackTrace>
<mailDebug>n</mailDebug>
</context>