我正在使用一个Spring boot应用程序,它使用带有Spring Data JPA的com.ibm.db2.jcc.DB2Driver驱动程序连接到AS400数据库。我使用org.hibernate.dialect.DB2Dialect方言。当我启动应用程序时,我收到错误消息
Could not fetch the SequenceInformation from the database
com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=SYSCAT.SEQUENCES;TABLE, DRIVER=4.26.14这意味着表SYSCAT.SEQUENCES丢失了,因为它不是必需的。该应用程序运行良好,但错误困扰我。据我所知,只有当我在某个地方生成一个ID时,SequenceInformations才是重要的,我不会做什么。这个应用程序只用于将数据从一个位置复制到另一个位置,所以我只使用JPAs @Id注释,而不使用@GeneratedValue注释。我是不是错过了SequenceInformation的一些用处?有什么方法可以关闭SequenceInformation的获取吗?
以下是我的应用程序属性:
spring:
datasource:
driver-class-name: com.ibm.db2.jcc.DB2Driver
hikari.connection-test-query: values 1
hikari.maximum-pool-size: 25
jpa:
database-platform: DB2Platform
hibernate.ddl-auto: none
open-in-view: false
properties:
hibernate:
dll-auto: none
dialect: org.hibernate.dialect.DB2Dialect
naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy发布于 2020-01-06 19:11:16
你用错了方言。请使用:
org.hibernate.dialect.DB2400Dialect发布于 2021-05-29 19:07:27
我已经把方言从DB2Dialect改成了DB2400Dialect,这对我很有效。
##spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.DB2Dialect
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.DB2400Dialecthttps://stackoverflow.com/questions/59610468
复制相似问题