提交 01db2d61 编写于 作者: T tristaZero

modify sharding-databases.yaml

上级 7845b599
......@@ -24,12 +24,10 @@ import org.apache.shardingsphere.shardingjdbc.api.yaml.YamlEncryptDataSourceFact
import javax.sql.DataSource;
import java.io.File;
import java.io.IOException;
import java.sql.SQLException;
public class YamlConfigurationExample {
public static void main(final String[] args) throws SQLException, IOException {
public static void main(final String[] args) {
DataSource dataSource = YamlEncryptDataSourceFactory.createDataSource(getFile());
CommonService userService = getUserService(dataSource);
userService.initEnvironment();
......
dataSources:
ds_0: !!com.zaxxer.hikari.HikariDataSource
dataSource: !!com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.jdbc.Driver
jdbcUrl: jdbc:mysql://localhost:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
jdbcUrl: jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
username: root
password:
ds_1: !!com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.jdbc.Driver
jdbcUrl: jdbc:mysql://localhost:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
username: root
password:
shardingRule:
broadcastTables:
- t_country
props:
sql.show: false
encryptRule:
encryptors:
name_encryptror:
type: aes
qualifiedColumns: t_user.name
props:
aes.key.value: 123456
pwd_encryptror:
type: assistedTest
qualifiedColumns: t_user.pwd
assistedQueryColumns: t_user.assisted_query_pwd
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册