Question Parameshwaran Muthaiyan · Aug 7, 2023

How to connect InterSystems with Quarkus 3.0 version

Can you please any one assist me for How to connect with the InterSystems IRIS in Java(Quarkus) version 3.0. 

Product version: IRIS 2023.2

Comments

Luis Angel Pérez Ramos · Aug 7, 2023

As far as I know, there is no extension to connect directly to IRIS using JDBC from Quarkus yet but you always have the option to connect using REST or TCP.

0
Parameshwaran Muthaiyan  Aug 7, 2023 to Guillaume Rongier

Hello Guilaume, Thanks it's really helpful. Now I can able to connect the IRIS database.

0
Guillaume Rongier  Aug 7, 2023 to Parameshwaran Muthaiyan

In theory you are all set. Just take for example the dockerfile.

You can also read the pom.xml file to take some insperation.

For example take a look how the jdbc driver is added to the project.

        <dependency>
            <groupId>intersystems</groupId>
            <artifactId>jdbc</artifactId>
            <version>3.3.0</version>
            <scope>system</scope>
            <systemPath>${pom.basedir}/lib/intersystems-jdbc-3.3.0.jar</systemPath>
        </dependency>

To sum up, you need obviously the jdbc drive (you have one in the repo), the hibernate dialect, you also have one in the repo, for the hibernete dialet you can also have a look to the article of yuri : https://community.intersystems.com/post/using-new-intersystems-iris-hibernate-6-dialect-springboot-project.

Have fun with Iris and quarkus.

0
Parameshwaran Muthaiyan · Aug 7, 2023

Thanks, Luis, for replying to me. In my queries, I am using Java JDK version 17 and Quarkus Platform version 3.1.0 (with the latest). Now, back to the point, which InterSystems jar version is suitable for this configuration? also we need to customise the Hibernate Dialect or no need for this version?

0
Parameshwaran Muthaiyan  Sep 8, 2023 to Dmitry Maslennikov

Hello Dmitry Maslennikov,

It's really helpful to learn how to connect IRIS with Quarkus, especially for real-world applications.

However, I encountered an issue while using your application and adding a new column. The data type for that column is Enumeration, and I annotated it with @Enumerated(EnumeratedType.STRING). Unfortunately, I'm unable to create the table due to a DDL issue. I have attached the code snippet and error image below:

 

 

Can you help me fix this problem and solve it?
Thank you for your assistance.

0
Dmitry Maslennikov  Sep 8, 2023 to Parameshwaran Muthaiyan

IRIS SQL does not have CHECK constraints, so, this syntax not available at all. Just try using a simple string, without enumeration.

0
Parameshwaran Muthaiyan  Sep 8, 2023 to Dmitry Maslennikov

Yes, Dmitry Maslennikov
 

We don't use CHECK constraint, by default Hibernate will generate this query. I don't know it has some issues in dialect file. It has become a mandatory requirement for us to use Enums in our application. I'm unsure why this functionality isn't achievable in Quarkus versions 3 and above. We previously achieved this in Quarkus version 2, and it worked seamlessly with other databases like MySQL and PostgreSQL. However, I'm puzzled as to why I can't annotate Enum types in the IRIS database.
Can you please tell us if is there any possible way to achieve it? 

Thanks in advance.

0
Luis Angel Pérez Ramos  Sep 8, 2023 to Parameshwaran Muthaiyan

As a former Java developer, my suggestion is not to use Enumerations, at the end that field is a common String, if you want to restrict the value of that column do it from the code, not from the database.

0
Yuri Marx  Sep 11, 2023 to Parameshwaran Muthaiyan

Fixed change the dependency for 1.1.1:

<dependency>
    <groupId>io.github.yurimarx</groupId>
    <artifactId>hibernateirisdialect</artifactId>
    <version>1.1.1</version>
</dependency>
0
Parameshwaran Muthaiyan  Sep 11, 2023 to Yuri Marx

Thanks yurimarx Marx,
Now, I was able to successfully connect to the database also create a table using Enum data type. Thank you very much for your help in this crucial time.

0