配置pom
<!-- 达梦数据库 -->
<dependency>
<groupId>com.dm</groupId>
<artifactId>dmjdbc7</artifactId>
<version>1.7.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/Dm7JdbcDriver17.jar</systemPath>
</dependency>
<dependency>
<groupId>com.dm.dialect</groupId>
<artifactId>hibernate4</artifactId>
<version>4.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/DmDialect-for-hibernate4.0.jar</systemPath>
</dependency>
application.yml
spring:
datasource:
driver-class-name: dm.jdbc.driver.DmDriver
url: jdbc:dm://192.168.16.195:5236/TOP_CMS_INSTANCE?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
username: SYSDBA
password: 123456789
jpa:
properties:
hibernate:
dialect: org.hibernate.dialect.DmDialect
配置durid连接池 --- 排除防火墙,wall
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
initial-size: 5
min-idle: 5
maxActive: 100
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
#validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
filters: stat,log4j #排除防火墙,wall
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
web-stat-filter:
enabled: true
url-pattern: "/*"
exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
stat-view-servlet:
url-pattern: "/druid/*"
allow: 127.0.0.1,192.168.16.48
deny: 192.168.3.111
reset-enable: false
login-username: admin
login-password: 123456