美文网首页
【Kingbase8数据库】springboot jpa集成Ki

【Kingbase8数据库】springboot jpa集成Ki

作者: 木头左 | 来源:发表于2024-04-05 21:14 被阅读0次

    Access to DialectResolutionInfo cannot be null when ‘hibernate.dialect’ not set

    去了stackoverflow: java - Spring Boot JPA - Access to DialectResolutionInfo cannot be null when ‘hibernate.dialect’ not set - Stack Overflow 不是PostgreSQL,那就换成mysql的嘛:

    spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.Kingbase8Dialect

    Could not load requested class : org.hibernate.dialect.Kingbase8Dialect

    增加方言类: class Kingbase8Dialect extends PostgreSQL9Dialect

        @Override
        public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData)
                throws SQLException {
    
            if (dbMetaData == null) {
                builder.setQuotedCaseStrategy(IdentifierCaseStrategy.MIXED);
            }
            builder.applyIdentifierCasing( dbMetaData );
    
            builder.applyReservedWords( dbMetaData );
            builder.applyReservedWords( AnsiSqlKeywords.INSTANCE.sql2003() );
            builder.applyReservedWords(super.getKeywords());
    
            builder.setNameQualifierSupport( getNameQualifierSupport() );
            builder.setUnquotedCaseStrategy(IdentifierCaseStrategy.MIXED);
            return builder.build();
    

    Caused by: java.lang.RuntimeException: Driver org.postgresql.Driver claims to not accept jdbcUrl, jdbc:kingbase8:

    增加配置: spring.datasource.ddb.driver-class-name=com.kingbase8.Driver

    couldn’t deduct database type from database product name ‘KingbaseES’

    [图片上传失败...(image-ae7aa1-1711757004626)]

    相关文章

      网友评论

          本文标题:【Kingbase8数据库】springboot jpa集成Ki

          本文链接:https://www.haomeiwen.com/subject/sauptjtx.html