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
Can you please any one assist me for How to connect with the InterSystems IRIS in Java(Quarkus) version 3.0.
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.
Hi, you will find here an example of Quarkus + IRIS + Hibernete :
https://github.com/grongierisc/iris-orm-examples
Hello Guilaume, Thanks it's really helpful. Now I can able to connect the IRIS database.
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-hibe....
Have fun with Iris and quarkus.
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?
Maybe this article can help you:
https://community.intersystems.com/post/using-new-intersystems-iris-hibe...
Hello Guillaume Rongier,
Can you confirm for me if the InterSystems JDBC driver is compatible with Panache Lock?
Have a look at this project https://github.com/daimor/realworld-api-quarkus-iris
I've migrated Realworld application made on Quarkus, to work with IRIS, it even uses CI to test it, and all tests passed
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.
IRIS SQL does not have CHECK constraints, so, this syntax not available at all. Just try using a simple string, without enumeration.
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.
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.
Fixed change the dependency for 1.1.1:
<dependency> <groupId>io.github.yurimarx</groupId> <artifactId>hibernateirisdialect</artifactId> <version>1.1.1</version> </dependency>
Thanks yurimarx Marx,
.png)
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.