简体   繁体   中英

How to connect Spring boot application with U2 universe database?

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM