This application component provides support for the Firebird database.
Additional documentation:
- CUBA Studio User Guide - Integrating with Custom Database
- CUBA Platform Developer’s Manual - Support for Other DBMSs
The integration is implemented using the following classes:
- FirebirdDdlGenerator - Implements functionality for generating DDL scripts and SQL statements for DB versioning.
- FirebirdDbProperties - Defines custom database properties required for using Firebird in a project.
- FirebirdDbmsFeatures - Implements the DbmsFeatures interface for Firebird.
- FirebirdDbTypeConverter - Implements the DbTypeConverter interface for Firebird.
- FirebirdSequenceSupport - Implements the SequenceSupport interface for Firebird.
- build.gradle - contains Firebird-specific database creation logic.
- Install CUBA Studio 14.3 or later.
- Download and install Firebird DB server.
- Download Jaybird JDBC driver (https://firebirdsql.org/en/jdbc-driver/). Extract ZIP archive and copy necessary driver files to the
{user home}/.haulmont/studio/lib
folder. E.g. for thejaybird-4.0.1.java8.zip
version the list of files to be copied is:jaybird-4.0.1.java8.jar
,antlr-runtime-4.7.2.jar
,connector-api-1.5.jar
,jna-5.5.0.jar
. - Open the project in the CUBA Studio (File -> New Project from Version Control)
- Modify the app.properties file and set correct paths in the
cuba.dataSource.jdbcUrl
and other nearby properties. Alternatively - change database URL in the Main Data Store Settings dialog (main menu: CUBA -> Main Data Store Settings). - Execute the CUBA -> Create Database task in the main menu.
- Start the project from the Studio.
- Execute steps mentioned above with the firebird-sample project to test that your environment is configured correctly.
- Run CUBA -> Advanced -> Install App Component task.
- Create new or open already existing project that needs Firebird support.
- Add just installed app component to your project (CUBA -> Marketplace -> Install Add-On manually button). Default add-on coordinates defined in this sample project are
com.company.firebird4:firebird-global:0.1-SNAPSHOT
. - In the Project Properties dialog select Firebird database type. Specify database URL in the
jdbc:firebirdsql://{HOST}/{PATH_TO_DB_FILE}?encoding=UTF8
format. - Make changes to the
build.gradle
script:
- Add Firebird dependency to the
buildscript
-dependencies
block. Find an example here. - Create a
FirebirdDbCreation
class which extends the AbstractDbCreation class and overrides the dropAndCreateDatabase method. Find an example here. - Replace the type of the
createDb
task withFirebirdDbCreation
instead ofCubaDbCreation
class. - Remove
masterUrl
,createDbSql
,dropDbSql
property of thecreateDb
task (or just make them empty).
- Execute the CUBA -> Create Database task in the main menu.
- Start the project from the Studio.
Directory where database files are located should be owned by the firebird
user running Firebird server.