【Kingbase8数据库】springboot jpa集成Kingbase8各种报错
【代码】【Kingbase8数据库】springboot jpa集成Kingbase8各种报错。
·
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();
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
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’
更多推荐
已为社区贡献1条内容
所有评论(0)