This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 78ea8a3  update database config in template file. (#16224)
78ea8a3 is described below

commit 78ea8a3f0805e48a3886cae93fad6b69d5ccc9bf
Author: Guocheng Tang <[email protected]>
AuthorDate: Mon Mar 21 00:42:52 2022 +0800

    update database config in template file. (#16224)
---
 .../template/jdbc/resources/properties/application.ftl | 18 +++++++++---------
 .../template/jdbc/resources/xml/application.ftl        | 18 +++++++++---------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git 
a/examples/shardingsphere-sample/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/application.ftl
 
b/examples/shardingsphere-sample/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/application.ftl
index b3d3317..133445f 100644
--- 
a/examples/shardingsphere-sample/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/application.ftl
+++ 
b/examples/shardingsphere-sample/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/application.ftl
@@ -30,23 +30,23 @@ spring.shardingsphere.datasource.names=ds-0,ds-1,ds-2
 
 spring.shardingsphere.datasource.ds-0.type=com.zaxxer.hikari.HikariDataSource
 spring.shardingsphere.datasource.ds-0.driver-class-name=com.mysql.jdbc.Driver
-spring.shardingsphere.datasource.ds-0.jdbc-url=jdbc:mysql://localhost:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
-spring.shardingsphere.datasource.ds-0.username=root
-spring.shardingsphere.datasource.ds-0.password=root
+spring.shardingsphere.datasource.ds-0.jdbc-url=jdbc:mysql://${host}:${(port)?c}/demo_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
+spring.shardingsphere.datasource.ds-0.username=${username}
+spring.shardingsphere.datasource.ds-0.password=${(password)?string}
 spring.shardingsphere.datasource.ds-0.max-active=16
 
 spring.shardingsphere.datasource.ds-1.type=com.zaxxer.hikari.HikariDataSource
 spring.shardingsphere.datasource.ds-1.driver-class-name=com.mysql.jdbc.Driver
-spring.shardingsphere.datasource.ds-1.jdbc-url=jdbc:mysql://localhost:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
-spring.shardingsphere.datasource.ds-1.username=root
-spring.shardingsphere.datasource.ds-1.password=root
+spring.shardingsphere.datasource.ds-1.jdbc-url=jdbc:mysql://${host}:${(port)?c}/demo_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
+spring.shardingsphere.datasource.ds-1.username=${username}
+spring.shardingsphere.datasource.ds-1.password=${(password)?string}
 spring.shardingsphere.datasource.ds-1.max-active=16
 
 spring.shardingsphere.datasource.ds-2.type=com.zaxxer.hikari.HikariDataSource
 spring.shardingsphere.datasource.ds-2.driver-class-name=com.mysql.jdbc.Driver
-spring.shardingsphere.datasource.ds-2.jdbc-url=jdbc:mysql://localhost:3306/demo_ds_2?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
-spring.shardingsphere.datasource.ds-2.username=root
-spring.shardingsphere.datasource.ds-2.password=root
+spring.shardingsphere.datasource.ds-2.jdbc-url=jdbc:mysql://${host}:${(port)?c}/demo_ds_2?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
+spring.shardingsphere.datasource.ds-2.username=${username}
+spring.shardingsphere.datasource.ds-2.password=${(password)?string}
 spring.shardingsphere.datasource.ds-2.max-active=16
 <#list feature?split(",") as item>
     <#include "${item}.ftl">
diff --git 
a/examples/shardingsphere-sample/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/xml/application.ftl
 
b/examples/shardingsphere-sample/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/xml/application.ftl
index 70e8177..e2c56ab 100644
--- 
a/examples/shardingsphere-sample/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/xml/application.ftl
+++ 
b/examples/shardingsphere-sample/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/xml/application.ftl
@@ -79,23 +79,23 @@
     
     <bean id="ds_0" class="com.zaxxer.hikari.HikariDataSource" 
destroy-method="close">
         <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
-        <property name="jdbcUrl" 
value="jdbc:mysql://localhost:3306/demo_ds_0?serverTimezone=UTC&amp;useSSL=false&amp;useUnicode=true&amp;characterEncoding=UTF-8"/>
-        <property name="username" value="root"/>
-        <property name="password" value="root"/>
+        <property name="jdbcUrl" 
value="jdbc:mysql://${host}:${(port)?c}/demo_ds_0?serverTimezone=UTC&amp;useSSL=false&amp;useUnicode=true&amp;characterEncoding=UTF-8"/>
+        <property name="username" value="${username}"/>
+        <property name="password" value="${(password)?string}"/>
     </bean>
     
     <bean id="ds_1" class="com.zaxxer.hikari.HikariDataSource" 
destroy-method="close">
         <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
-        <property name="jdbcUrl" 
value="jdbc:mysql://localhost:3306/demo_ds_1?serverTimezone=UTC&amp;useSSL=false&amp;useUnicode=true&amp;characterEncoding=UTF-8"/>
-        <property name="username" value="root"/>
-        <property name="password" value="root"/>
+        <property name="jdbcUrl" 
value="jdbc:mysql://${host}:${(port)?c}/demo_ds_1?serverTimezone=UTC&amp;useSSL=false&amp;useUnicode=true&amp;characterEncoding=UTF-8"/>
+        <property name="username" value="${username}"/>
+        <property name="password" value="${(password)?string}"/>
     </bean>
     
     <bean id="ds_2" class="com.zaxxer.hikari.HikariDataSource" 
destroy-method="close">
         <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
-        <property name="jdbcUrl" 
value="jdbc:mysql://localhost:3306/demo_ds_2?serverTimezone=UTC&amp;useSSL=false&amp;useUnicode=true&amp;characterEncoding=UTF-8"/>
-        <property name="username" value="root"/>
-        <property name="password" value="root"/>
+        <property name="jdbcUrl" 
value="jdbc:mysql://${host}:${(port)?c}/demo_ds_2?serverTimezone=UTC&amp;useSSL=false&amp;useUnicode=true&amp;characterEncoding=UTF-8"/>
+        <property name="username" value="${username}"/>
+        <property name="password" value="${(password)?string}"/>
     </bean>
 <#list feature?split(",") as item>
     <#include "${item}.ftl">

Reply via email to