我用springboot开发了一个web服务,我需要它在我的impala数据库中保存一些信息。
我在impala中搜索保存,只找到了如何使用JDBC。
有人知道我是否可以使用spring-boot和spring-jpa在impala中保存数据吗?
我的.yml
server:
port: 8080
spring:
config:
name: **
cloud:
loadbalancer:
ribbon:
enable: false
datasource:
url: jdbc:impala://...
username: ...
password: ...
driver-class-name: io.opentracing.contrib.jdbc.TracingDriver (I think this is not the correct but i find another)
我的pom.xml
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<dependency>
<groupId>com.cloudera.impala.jdbc</groupId>
<artifactId>ImpalaJDBC41</artifactId>
<version>2.6.4.1005</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>es.caser.archit.spring</groupId>
<artifactId>db-caf-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>es.caser.archit.spring</groupId>
<artifactId>rest-caf-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>es.caser.archit.spring</groupId>
<artifactId>test-caf-boot-starter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>es.caser.archit.spring</groupId>
<artifactId>security-caf-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies>
感谢:D
驱动程序类名应该是
driverClassName: org.apache.hive.jdbc.HiveDriver
并使用这个依赖
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-jdbc</artifactId>
<version>3.1.2</version>
</dependency>