How to connect Spring boot application with U2 universe database?

396 views Asked by At

I am using Spring boot version 2.6 , i want to use U2 universe as database. My question is how to setting a connection in application.properties?

1

There are 1 answers

1
user20545477 On

STEP 1: Install Rocket software and download unijdbc.jar(you can find the jar inside the path \U2\UniDK\jdbc\lib).

STEP 2 : Create Lib folder in your spring boot project and put the jar inside the folder.

STEP 3 : go to pom.xml file and add below dependency

 <dependency>
        <groupId>uni-jdbc</groupId>
        <artifactId>uni-jdbc</artifactId>
        <version>2.161.2</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/libs/uni-jdbc.jar</systemPath>
 </dependency>

STEP 4 : In application.properties file provide the datasourse details.

     spring.datasource.url=jdbc:rs-u2://hostname/Account?dbmstype=UNIDATA
     spring.datasource.username=username
     spring.datasource.password=Password
     spring.datasource.driver-class-name=com.rs.u2.jdbc.UniJDBCDriver

Make sure your URL details is correct. jdbc:rs-u2://"+host+"/"+account+"?dbmstype="+dbmstype+

STEP 5: to check the connection, run your application in debug level by adding below properties in application.properties.

logging.level.com.zaxxer.hikari=DEBUG