How to set up IRIS database with Quarkus - java

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

I found the solution, to set up Intersystems IRIS on Quarkus you need to add manually the jar file, and also you need to set up the pom.xml also some setup from Intersystems was made as a java class. you can see the solution looking at my project on GitHub
this is the link: https://github.com/JoseAdemar/quarkus-project-with-intersystems-ris-database

Related

Connect SMB endpoint with Camel v3 and the camel-jcifs from camel-extra

I have the following maven versions in my pom.xml (among others):
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>org.apache-extras.camel-extra</groupId>
<artifactId>camel-jcifs</artifactId>
<version>2.25.2</version>
<exclusions>
<exclusion>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</exclusion>
</exclusions>
</dependency>
Camel spring-boot version = 3.7.0 and I want to connect to a SMB endpoint like this:
smb://sharedriveuser#server-instance.sub.domain.net/folder?initialDelay=0&delay=9000&autoCreate=false&noop=true&idempotent=true&password=ThePassWorD&filter=#csvFileFilter
I read the Camel 3 Migration Guide and found nothing regarding this camel-extras.
When trying to connect, I get an error like the password option is not supported anymore:
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: smb://sharedriveuser#server-instance.sub.domain.net/folder?initialDelay=0&delay=9000&autoCreate=false&noop=true&idempotent=true&password=xxxxxx&filter=#csvFileFilter due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{password=ThePassWorD}]
The actual documentation link google found many times, seems dead.
From Maven central, there is no version 3.x of the lib camel-jcifs and I am wondering if the lib is still compatible with Camel 3.x.x, otherwise is there another alternative with Camel 3?
I also tried to downgrade the camel-jcifs to 2.24.3 with the same error.
Camel-extras is a separated project from the Apache Camel. There is some work in place in the camel-extra repository to support camel 3[1], but it is still to be completed and there is no release in sight.
[1] https://github.com/camel-extra/camel-extra/commit/f028dfdfaa467958c58abea0d604f8fe2f17be04
There is now a pull request to add camel-jcifs to the 3.x version:
https://github.com/camel-extra/camel-extra/pull/39
You might also get my fork and build it yourself:
https://github.com/bebbo/camel-extra *
It got merged and is in the official repository:
https://github.com/camel-extra/camel-extra
To use it with quarkus, you have to convert some List types to arrays.

How to set the variable instrumentationKey for azure monitoring in a spring boot application

I have a issue to setup azure monitoring in spring boot project.
i have the error at each start:
instrumentationKey must be set to report metrics to Azure Monitor.
i have set the application.properties with the following properties:
azure.application-insights.instrumentation-key=VALID-UUID
spring.application.name=test
the dependency of the project looks like:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.1.3</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-spring-boot-metrics-starter</artifactId>
<version>2.1.4</version>
</dependency>
As per this https://learn.microsoft.com/en-us/azure/azure-monitor/app/micrometer-java#using-spring-2x documentation you need to add application-insights-springboot-starter as well.
Otherwise, you can set key as azuremonitor.instrumentationKey. My recommendation would be to add application-insights-springboot-starter along with azure-spring-boot-metrics-starter
Tracing by dependency
azure-spring-boot-metrics-starterazure-spring-boot-metrics-starter -->
micrometer-registry-azure-monitor -->
com.microsoft.azure:applicationinsights-core
Your error message come from AzureMonitorConfig
So I think the key be modify to
azuremonitor.instrumentationKey

How to connect a spring boot application hosted on Google cloud engine to a mysql db?

I want to deploy my java spring boot application on Google cloud engine. It works well when I do not configure a db. But then when I use jpa, it just cannot find the connection. I tried multiple approached but non worked so far.
spring:
jpa:
database: MYSQL
show-sql: false
hibernate:
ddl-auto: update
datasource:
driver-class-name: com.mysql.jdbc.GoogleDrive
username: root
password: ********
url: jdbc:google:mysql://something-app:us-central1:something/something?user=root
This is the last config that I tried but it cannot find the driver. I have this in my pom.cml
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>mysql-socket-factory</artifactId>
<version>1.0.0-beta1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.4</version>
</dependency>
Any idea of what I am doing wrong. Or example (github or other) that has it working?
stack trace:
2016-10-08 14:13:13 default[20161008t161026] java.sql.SQLException: Driver:com.google.appengine.api.rdbms.AppEngineDriver#746b25b1 returned null for URL:jdbc:google:mysql://something-app:us-central1:something/something?user=root
I finally got it working with the following configuration.
spring:
jpa:
database: MYSQL
show-sql: false
hibernate:
ddl-auto: update
datasource:
url: jdbc:mysql://google/myproject?cloudSqlInstance=myproject-app:us-central1:myproject&socketFactory=com.google.cloud.sql.mysql.SocketFactory&user=******&password=**********
I used this in the pom.xml
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>mysql-socket-factory</artifactId>
<version>1.0.1</version>
</dependency>

Spring Boot Unable to load class: com.microsoft.sqlserver.jdbc.SQLServerDriver

I've created a new Spring Boot project. I'm trying to setup a DataSource to use MSSQL. However I seem to be getting the error "Unable to load class: com.microsoft.sqlserver.jdbc.SQLServerDriver"
I've placed the file jdbcsql4.jar in a folder in my project /lib/jdbcsq4.jar
In my pom.xml file I've added the following:
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
<scope>system</scope>
<optional>true</optional>
<systemPath>${basedir}/lib/sqljdbc4.jar</systemPath>
</dependency>
I have an application.properties file, and I'm defining the database credentials like this:
secondary.datasource.url = jdbc:sqlserver://1.1.1.1:50109
secondary.datasource.username = sa
secondary.datasource.password = mypassword
secondary.datasource.driver-class-name = com.microsoft.sqlserver.jdbc.SQLServerDriver
Can anyone possibly indicate where I may be going wrong?
I managed to solve this issue by following the instructions in this link http://claude.betancourt.us/add-microsoft-sql-jdbc-driver-to-maven/
EDIT:
The original link above no longer exists, but here's a similar link.
http://biercoff.com/add-microsoft-sql-jdbc-driver-to-maven/
For the ppl who facing these issue.
Add dependency in POM.
Microsoft finally made the driver available on the Maven Central Repository.
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.1.0.jre8</version>
</dependency>
you can check here.
Microsoft link

PostgreSQL + Openshift: Possibly the wrong driver for the given database URL?

I am trying to run the liquibase update from Openshift machine that I have. It looks like
> java -jar ~/.m2/repository/org/liquibase/liquibase-core/3.1.1/liquibase-core-3.1.1.jar --driver=org.postgresql.Driver --classpath=wildfly/standalone/deployments/ROOT.war --changeLogFile=liquibase/changelog.xml --url="jdbc:$OPENSHIFT_POSTGRESQL_DB_URL/mydb" --username=$OPENSHIFT_POSTGRESQL_DB_USERNAME --password=OPENSHIFT_POSTGRESQL_DB_PASSWORD update
and I see the following error
Liquibase update Failed: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Connection could not be created to jdbc:postgresql://admin:29asDVjpFxYl6#127.8.201.2:5432/mydb with driver org.postgresql.Driver. Possibly the wrong driver for the given database URL
What is going wrong here?
I am using the following postgreSQL dependency
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901-1.jdbc4</version>
</dependency>
there were 2 issues that were fixed as following
a.) using postgres 9.2 driver
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.2-1003-jdbc4</version>
</dependency>
b.) using the following url
--url="jdbc:postgresql://$OPENSHIFT_POSTGRESQL_DB_HOST:$OPENSHIFT_POSTGRESQL_DB_PORT/mydb"

Categories

Resources