用户(user):用来连接数据库访问数据库
模式(schema):模式对象是数据库数据的逻辑结构
关系:模式跟用户在oracle 是一对一的关系,dm是一对多(mysql中没有模式概念)
dm和Oracle的小写字母没有用双引号引起来会被识别为大写
postgreSql中的大写字母没有引起来会被识别为小写
注意表名的大小写也会影响
mysql数据源
spring.datasource.primary.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.primary.jdbc-url=jdbc:mysql://localhost:3306/db1?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
spring.datasource.primary.username=abc
spring.datasource.primary.password=123456
dm数据库连接
spring.datasource.druid.filters=
spring.datasource.druid.driver-class-name=dm.jdbc.driver.DmDriver
spring.datasource.druid.url=jdbc:dm://xxx.xxx.xxx.xxx:5236/xxx/
spring.datasource.druid.username=xxx
spring.datasource.druid.password=xxxx
注意:
spring.datasource.druid.filters不能少
url最后有个/
依赖
```xml
<dependency>
<groupId>com.dameng</groupId>
<artifactId>dm-jdbc</artifactId>
<version>1.8</version>
</dependency>
第二种
```xml
spring.datasource.druid.filters=
spring.datasource.driverClassName=dm.jdbc.driver.DmDriver
spring.datasource.url=jdbc:dm://xxx.xxx.xxx.xxx:5236?schema=xxx&compatibleMode=mysql&characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
#spring.datasource.username=xxx
#spring.datasource.password=xxxx
启动类的注解
@SpringBootApplication(exclude= {DruidDataSourceAutoConfigure.class,
DataSourceTransactionManagerAutoConfiguration.class,
HibernateJpaAutoConfiguration.class})
<dependency>
<groupId>com.dameng</groupId>
<artifactId>Dm8JdbcDriver18</artifactId>
<version>8.1.1.49</version>
</dependency>
postgresql
spring.datasource.druid.driver-class-name=org.postgresql.Driver
spring.datasource.druid.url=jdbc:postgresql://xxx.xxx.xxx.xxx:5432/test?stringtype=unspecified
spring.datasource.druid.username=postgres
spring.datasource.druid.password=postgres
oracle
spring.datasource.driverClassName=oracle.jdbc.driver.OracleDriver
spring.datasource.url=jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:xe
spring.datasource.username=lowcode
spring.datasource.password=lowcode
SqlServer
默认模式为dbo
spring.datasource.second.jdbc-url=jdbc:sqlserver://localhost:1433;database=DB2
spring.datasource.second.username=abc
spring.datasource.second.password=123456
spring.datasource.second.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
#kingbase 人大金仓数据库
jdbc.driver=com.kingbase8.Driver
jdbc.url=jdbc:kingbase8://xxx.xxx.xxx.xxx:5432/test?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
jdbc.username=xxxx
jdbc.password=xxxxx
mysql存储过程和函数的表