amazon-web-services - Spring Boot 连接 Redshift 序列
问题描述
我正在尝试使用 Spring Boot 和 JPA 在 Redshift 数据库上连接来运行我的应用程序,但没有成功。谷歌搜索发现一些人有同样的问题,但建议是更改 RDS 或其他数据库,但我没有这个选项。在 Redshift 中 information_schema.sequences 不存在,所以我应该找到解决这个问题的方法
问题是:
无效操作:关系“information_schema.sequences”不存在;
在 Pom.xml 中:
<dependency>
<groupId>com.amazon.redshift</groupId>
<artifactId>redshift-jdbc4</artifactId>
<version>1.2.10.1009</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
在我的 application.properties 中:
spring.datasource.driver-class-name=com.amazon.redshift.jdbc4.Driver
spring.datasource.url=jdbc:redshift://redshift-cluster-1.xxxxxxxx.us-west-2.redshift.amazonaws.com:xxxx/db
spring.datasource.username=xxxxxxxx
spring.datasource.password=xxxxxxxx
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
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation = true
spring.jpa.properties.hibernate.current_session_context_class =org.springframework.orm.hibernate5.SpringSessionContex
但是在启动应用程序时,控制台显示:
2019-11-27 23:48:50.414 错误 16608 --- [main] ohejeinternal.JdbcEnvironmentImpl:无法从数据库中获取 SequenceInformation java.sql.SQLException:亚马逊无效操作:关系“information_schema.sequences”不存在;在 com.amazon.redshift.client.messages.inbound.ErrorResponse.toErrorException(Unknown Source) ~[na:na] at com.amazon.redshift.client.PGMessagingContext.handleErrorResponse(Unknown Source) ~[na:na] at com .amazon.redshift.client.PGMessagingContext.handleMessage(Unknown Source) ~[na:na] at com.amazon.jdbc.communications.InboundMessagesPipeline.getNextMessageOfClass(Unknown Source) ~[na:na] at com.amazon.redshift.client .PGMessagingContext.doMoveToNextClass(Unknown Source) ~[na:na] at... 引起:com.amazon.support.exceptions.ErrorException:亚马逊无效操作:关系“information_schema.sequences”不存在;...省略了 54 个常见框架 2019-11-27 23:48:51.487 WARN 16608 --- [main] ohengine.jdbc.spi.SqlExceptionHelper:SQL 错误:500310,SQLState:42P01 2019-11-27 23:48: 51.487 错误 16608 --- [
main] ohengine.jdbc.spi.SqlExceptionHelper:亚马逊无效操作:关系“information_schema.sequences”不存在;
如果有人帮助我,我将非常感激!!!!
解决方案
推荐阅读
- javascript - 为什么 JSON 解析不会在以“t”开头的字符串的第一个字符上失败?
- go - Golang AWS S3 批量对象创建
- sql - 在 SQL 中定义只需要 10 位数字的列名
- sql - 具有 PK 和具有 UNIQUE 约束的表是否有任何区别
- android - 无法在android中获取CheckBox的引用
- ruby - 重复字符串 N 次 - 乘法 VS 枚举器
- javascript - 验证标记是否在路线内
- java - 如何从jsp中的控制器获取json数据?
- python-3.x - 使用同一行中的文本替换多行字符串中的文本
- python - df[~df.id.isin 没有从原始 df 中删除任何内容