Connect Firebird database

Hi, Would need some support how to configure CUBA to work with Firebird database. I assume jdbc would be the way to go.
But I am rookie in the field and would need some specific description how to do it so I dont lose my way… thanks /R

2 Likes

Hello,

Do you want to use Firebird as a main database of your application, or just as additional data source for integration with an existing database?

Hi, Think the best would be to use firebird as the main database, that would unify it with the existing solution we would like to extend. /R

The platform does not support Firebird out-of-the-box, however you can use it if you implement certain interfaces as explained here: https://doc.cuba-platform.com/manual-6.3/arbitrary_dbms.html

The main problem is that Studio does not support Firebird at all and you will not be able to develop the application with Studio, which is probably a showstopper for most of our users. In theory, you could select a different database in Studio and switch to Firebird at some point, but I think it would be awkward and not worth the efforts.

So if you just integrating with an existing solution, you can create a completely new application using for example PostgreSQL and connect to Firebird through an additional JDBC data source to read-write some data. If you rather need to extend the existing system to a large extent, consider full migration to another database.

Let us know if you need assistance on any of these paths.

Thanks, How about a scenario when I would create a database link between the main database used by CUBA (lats say HSQL) and the additional firebird database (like linked tables). Would that be possible… ?

As an alternative, if I would like to do import regularly through JDBC to lets say into the HSQL from the firebird… how could that be organised with CUBA? /R

I cannot say anything about database links, never used them for databases of different types.

As for importing data, if it is a one-off migration, it can be organized as follows:

  • Create a JDBC datasource in context.xml

  • Define it in spring.xml of your core module, for example:


<bean id="myDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="java:comp/env/jdbc/MyDS"/>
    <property name="resourceRef" value="true"/>
</bean>
  • Create a JMX bean with an import() method

  • In the import() method, obtain your DataSource via AppBeans.get(“myDataSource”) and use it to load data from your Firebird database through JDBC or QueryRunner.

  • Create data model and map your new entities to tables in PostgreSQL.

  • In the import() method, iterate through rows of your Firebird tables, create and fill instances of entities and use EntityManager or DataManager to save entities to the new database.

  • After starting your application server for the first time on a new database, go to Administration > JMX Console, find your JMX bean and start import.

Hi Konstantin,
I am interested in using Firebird too.

…with all the power of CUBA UI datasources and RAD.
I read all the previous comments, but I read some other topics that make me have hope.

Is it possible to apply something similar to this:
https://www.cuba-platform.com/discuss/t/ms-sqlserver2000#comment-7488
for Firebird?

Here it is another interesting comment of yours:
https://www.cuba-platform.com/discuss/t/attach-external-databases#comment-1048
But I’m not sure what “[…] In order to display these data in standard CUBA UI, you can map the data to non-persistent entities of your standard data model” means…

Best regards,
and thanks for your great work!

Hi Simone,

First of all, let’s distinguish the platform itself as a runtime framework from Studio as a design-time tool. On one hand, the platform can work with any DBMS supported by EclipseLink ORM, and the documentation explains how to set up your project for an arbitrary DBMS. On the other hand, Studio works only with a limited number of databases because it must know their specifics to generate correct DDL scripts.

The topic about MS SQLServer 2000 is not quite relevant, because Studio already supports SQLServer and question is only about connection parameters required by the JDBC driver. The topic on additional data stores is outdated and all that is discussed there is already implemented, see Data Stores.

As a result, your application should be able to work with Firebird if you implement the required interfaces and provide parameters to Gradle tasks. But you will have to create DDL scripts for your data model (including CUBA entities) manually and there is no way to make Studio do it.

Ok, thank you Konstantin. I don’t want to loose the cool design-time features of Cuba Studio… So I’m evaluating the migration of the database.

Hello all,

We have the same problem as RolandA and Simone.

Just a few days ago I “found” the Cuba platform" and at first glance it meets all our requirements perfectly. Unfortunately, we need to upgrade or replace a Firebird SQL application. Since there are many legacy applications that also access the Firebird database and cannot be extended or modified, migration to another RDBMS is not possible. If I understand everything correctly, the use of cuba patform only makes sense if cuba studio fully supports the firebird sql database. Does Haulmont plan to support Firebird SQL DB? That would be great.

Hi Horst,
I understand your situation. We are not going to support Firebird out-of-the-box, but we want to implement support for a “generic relational database” with ability to configure it on the project level, see https://youtrack.cuba-platform.com/issue/STUDIO-3939.

Hi Konstantin,

thank you and I am looking forward this …
Unfortunately I cannot access the link as credentials are required …

Horst

Sorry. The link is correct now.