缺少序列信息 [英] SequenceInformation missing

查看:72
本文介绍了缺少序列信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Spring引导应用程序,该应用程序通过com.ibm.db2.jcc.DB2Driver驱动程序和Spring Data JPA连接到AS400数据库.我使用org.hibernate.dialect.DB2Dialect方言.启动应用程序时,出现错误

I'm working with a Spring boot Application connecting to an AS400 Database using the com.ibm.db2.jcc.DB2Driver driver with Spring Data JPA. I use the org.hibernate.dialect.DB2Dialect dialect. When I start the Application, I get the Error

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 丢失了,因为它是不需要的.该应用程序工作正常,但错误困扰着我.据我所知,SequenceInformations仅在我在某个地方生成ID时才重要,而我不这样做.此应用程序仅用于将数据从一个地方复制到另一个地方,因此我仅使用JPA的 @Id 注释,而不使用 @GeneratedValue 的注释.我是否缺少一些用于SequenceInformation的用途?有什么方法可以关闭对SequenceInformation的获取吗?

Meaning the Table SYSCAT.SEQUENCES is missing, which it is, because it's not needed. The Application works fine, but the error bothers me. As far as I see, SequenceInformations are only important when I generate an ID somewhere, what I don't do. This Application is only used to copy data from one place to another, so I only use JPAs @Id annotation but not the @GeneratedValue one. Am I missing some use for the SequenceInformation? Is there some way to turn off the fetching of SequenceInformation?

这些是我的应用程序属性:

Those are my application properties:

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

推荐答案

您使用了错误的方言.请使用:

You use the wrong dialect. Please use:

org.hibernate.dialect.DB2400Dialect

这篇关于缺少序列信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆