How to set up IRIS database with Quarkus
Hello Programmers,
I'm trying to use Intersystems IRIS Database with
Quarkus, but I'm getting problems making it work
does anyone knows how to set up the Intersystems IRIS Database
on Quarkus ?
I did that on my pom.xml and also I added the jar
hibernate-iris-1.0.0.jar and intersystems-jdbc-3.2.0.jar but it's not working
<dependency>
<groupId>com.intersystems</groupId>
<artifactId>intersystems-jdbc</artifactId>
<version>3.2.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/intersystems-jdbc-3.2.0.jar</systemPath>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-iris</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/hibernate-iris-1.0.0.jar</systemPath>
</dependency>
This is my application.properties
quarkus:
datasource:
db-kind: other
username: _system
password: *****
jdbc:
url: jdbc:IRIS://localhost:1972/USER
driver: com.intersystems.jdbc.IRISDriver
hibernate-orm:
dialect: org.hibernate.dialect.InterSystemsIRISDialect
jdbc:
timezone: UTC
You must manually add the jdbc jar file. InterSystems JDBC driver is not available on maven.
Do you know how I can get the jar file?
I was looking to download
but I'm not getting much information
https://github.com/intersystems-community/iris-driver-distribution
Thank you @Dmitry Maslennikov
I download the jar files but I didn't get to set up
it's not working.
Thank you @Eduard Lebedyuk
I download the jar files and added but I didn't get to set up
it's not working.
You still need the iris hibernate dialect.
You can find it here : https://github.com/intersystems/quickstarts-java
https://github.com/intersystems/quickstarts-java/tree/master/src/org/hib...
Guys, I still couldn't set up the Intersystems IRIS database on quarkus, does anyone has already done this to help me?
You will find here a demo of a quarkus rest crud api with iris as a database.
https://github.com/grongierisc/quarkus-iris
It's not using the Hibernate ORM but this shouldn't be an issue.
Thanks, @Guillaume Rongier
I'm going to try following this project and if I get it
I'm going to give you some feedback.
I tried this setup but it didn't work
using other databases, I can set up easily
I tried that but still, it's not working:
pom.xml
<dependency>
<groupId>com.intersystems</groupId>
<artifactId>intersystems-jdbc</artifactId>
<version>3.2.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/intersystems-jdbc-3.2.0.jar</systemPath>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-iris</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/hibernate-iris-1.0.0.jar</systemPath>
</dependency>
application.properties
quarkus.datasource.db-kind=other
quarkus.datasource.username=_system
quarkus.datasource.password=*
quarkus.datasource.reactive.url=jdbc:IRIS://localhost:1972/USER
quarkus.datasource.jdbc.driver=com.intersystems.jdbc.IRISDriver
quarkus.hibernate-orm.dialect=org.hibernate.dialect.InterSystemsIRISDialect
the repository is updated to show you how to play with quarkus + iris + orm + iris dialect :
https://github.com/grongierisc/quarkus-iris/tree/master/quarkus-iris-orm-quickstart
Hope this help, can't help you more with just config files.
Thank you so much!
I'm going to check the repository.
looking at his code I could see his project is a little bit different from mine. I'm using panache orm
Example:
my Repository
@ApplicationScoped
public class ClientRepository implements PanacheRepositoryBase<Client,Long>{
}
my Entity
@Data
@NoArgsConstructor
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
@Entity
@Table(name = "tbl_client")
public class Client {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@EqualsAndHashCode.Include
private Long id;
@Size(max = 50)
@Column(name = "first_name")
private String firstName;
@Size(max = 50)
@Column(name = "last_name")
private String lastName;
}
my Controller
@Path("/api/guests")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class ClientController {
private final ClientService clientService;
public ClientController(ClientService clientService) {
this.clientService = clientService;
}
@POST
public Response createClient(@RequestBody Client client) {
clientService.create(client);
return Response.status(Status.CREATED).entity(client).build();
}
}
This the link of my project on GitHub
https://github.com/JoseAdemar/quarkus-project-with-intersystems-ris-data...
I publish a PR to your repo.
What I did, I removed your hibernate jar, doesn't know what is in, so I directly used dialect code.
Then, in you property files you named the iris connection string : quarkus.datasource.reactive.url
instead of quarkus.datasource.jdbc.url.
That's it.
Thank you so much @Guillaume.Rongier 7183 I got it to connect Intersystems IRIS Database with quarkus and the project is running, also, the ORM is working because it created the table automatically
the only problem that I'm having now is when I'm trying to call the method POST or GET I'm getting the following message
415 Unsupported Media Type.
Also, I tried to change the quarkus.datasource.jdbc.url. by
quarkus.datasource.reactive.url but when I did that didn't work
I updated the project on GitHub maybe you can help me with this message error running my project
https://github.com/JoseAdemar/quarkus-project-with-intersystems-ris-data...
I did a last PR.
Many small fixes (check every commit).
Now I can't help you more, it's java stuff and it's no more related to IRIS.
Thank you so much @Guillaume Rongier
for your help and also for being patient with me. Now my project is running correctly you helped me to find a solution.
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue