1. Oracle数据
1. 添加oracle驱动,修改pom.xml
<!-- oracle驱动 -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
2. 修改数据库连接
修改druid配置
validationQuery: SELECT 1 FROM DUAL
driver-class-name: oracle.jdbc.OracleDriver
url: jdbc:oracle:thin:@192.168.1.200:1521:ORCL
username: jeecgboot
password: jeecgboot
2. SQL server数据
1. 添加SQL server驱动,修改pom.xml
<!-- sqlserver-->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
<scope>runtime</scope>
</dependency>
2. 修改数据库连接
修改druid配置
validationQuery: SELECT 1
filters: stat,slf4j
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://192.168.1.200:1433;SelectMethod=cursor;DatabaseName=jeecg-boot
username: sa
password: SA
3. postgresql数据库
1. 添加postgresql驱动,修改pom.xml
<!-- postgresql-->
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
2. 修改数据库连接
增加spring下的配置
spring:
#postgresql 报错问题
jpa:
properties:
hibernate:
temp:
use_jdbc_metadata_defaults: false
#修改druid配置
validationQuery: SELECT 1
url: jdbc:postgresql://localhost:5432/postgres
username: postgres
password: root
driver-class-name: org.postgresql.Driver
网友评论