小编Sha*_*vas的帖子

spring boot 2 和 Redshift 连接。

我正在尝试将 spring boot2 与 redshift 连接,因为 spring boot 2 默认使用 hikariCP 并且 hikariCP 没有明确的支持。有谁已经成功连接到redshift了吗?

这是我的 Spring boot 2 属性

spring.datasource.driver-class-name=com.amazon.redshift.jdbc41.Driver
spring.datasource.url=jdbc:redshift://<someHost>.redshift.amazonaws.com:5439/XXX
spring.datasource.username=xxxxxx
spring.datasource.password=xxxxxx


spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1

spring.jpa.show-sql = true
spring.jpa.hibernate.ddl-auto=validate
spring.jpa.properties.hibernate.dialect =  org.hibernate.dialect.PostgreSQL9Dialect
Run Code Online (Sandbox Code Playgroud)

Maven POM.XML

        <dependency>
        <groupId>com.amazon.redshift</groupId>
        <artifactId>redshift-jdbc41</artifactId>
        <version>1.2.10.1009</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

当我启动服务器时,我收到以下警告和错误

2018-03-29 00:00:52.740  WARN 23279 --- [           main] com.zaxxer.hikari.util.DriverDataSource  : Registered driver with driverClassName=com.amazon.redshift.jdbc41.Driver was not found, trying direct instantiation.
2018-03-29 00:00:54.443  INFO 23279 --- [           main] com.zaxxer.hikari.pool.PoolBase          : HikariPool-1 - Driver …
Run Code Online (Sandbox Code Playgroud)

jpa amazon-redshift spring-boot

5
推荐指数
1
解决办法
7733
查看次数

标签 统计

amazon-redshift ×1

jpa ×1

spring-boot ×1