Question
· Feb 4, 2022

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

Product version: IRIS 2021.2
Discussion (17)0
Log in or sign up to continue

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

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...

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...