【DM版本】:8
【操作系统】:windows11
【CPU】:
【问题描述】*:
报错信息
2022-05-18 16:06:57.629 WARN 42640 --- [ main] o.h.e.j.e.i.JdbcEnvironmentInitiator : HHH000342: Could not obtain connection to query metadata : Unable to determine Dialect to use [name=DM DBMS, majorVersion=8]; user must register resolver or explicitly set 'hibernate.dialect' 2022-05-18 16:06:57.635 WARN 42640 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] 五月 18, 2022 4:06:57 下午 org.apache.catalina.core.StandardService stopInternal 信息: Stopping service [Tomcat] 2022-05-18 16:06:57.676 ERROR 42640 --- [ main] o.s.boot.SpringApplication : Application run failed
数据库版本DM DBMS (ver. 8.1.1.126)
pom依赖:
<dependency>
<groupId>com.dameng</groupId>
<artifactId>Dm8JdbcDriver18</artifactId>
<version>8.1.1.126</version>
</dependency>
<dependency>
<groupId>com.dameng</groupId>
<artifactId>DmDialect-for-hibernate</artifactId>
<version>5.3</version>
</dependency>
yaml配置
#【spring】配置:
spring:
datasource:
driver-class-name: dm.jdbc.driver.DmDriver
url: jdbc:dm://172.20.183.150:5236?logLevel=all&logDir=d:\jdbclog
username: SYSDBA
password: SYSDBA
Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: STRING
添加方言已解决:
#【spring】配置: spring: datasource: driver-class-name: dm.jdbc.driver.DmDriver url: jdbc:dm://172.20.183.150:5236?logLevel=all&logDir=d:\jdbclog username: SYSDBA password: SYSDBA jpa: properties: hibernate: dialect: org.hibernate.dialect.DmDialect