Loading sharding-jdbc-example/raw-jdbc-example/src/main/java/io/shardingsphere/example/jdbc/main/nodep/java/MasterSlaveOnly.java +2 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import io.shardingsphere.api.config.MasterSlaveRuleConfiguration; import io.shardingsphere.example.jdbc.util.DataSourceUtil; import io.shardingsphere.example.repository.jdbc.repository.RawOrderItemRepository; import io.shardingsphere.example.repository.jdbc.repository.RawOrderRepository; import io.shardingsphere.example.repository.jdbc.service.DemoService; import io.shardingsphere.example.repository.jdbc.service.RawDemoService; import io.shardingsphere.shardingjdbc.api.MasterSlaveDataSourceFactory; import javax.sql.DataSource; Loading @@ -39,7 +39,7 @@ public class MasterSlaveOnly { public static void main(final String[] args) throws SQLException { DataSource dataSource = getDataSource(); new DemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); new RawDemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); } private static DataSource getDataSource() throws SQLException { Loading sharding-jdbc-example/raw-jdbc-example/src/main/java/io/shardingsphere/example/jdbc/main/nodep/yaml/MasterSlaveOnly.java +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ package io.shardingsphere.example.jdbc.main.nodep.yaml; import io.shardingsphere.example.repository.jdbc.repository.RawOrderItemRepository; import io.shardingsphere.example.repository.jdbc.repository.RawOrderRepository; import io.shardingsphere.example.repository.jdbc.service.DemoService; import io.shardingsphere.example.repository.jdbc.service.RawDemoService; import io.shardingsphere.shardingjdbc.api.yaml.YamlMasterSlaveDataSourceFactory; import javax.sql.DataSource; Loading @@ -32,7 +32,7 @@ public class MasterSlaveOnly { public static void main(final String[] args) throws Exception { DataSource dataSource = YamlMasterSlaveDataSourceFactory.createDataSource(getYamlFile()); new DemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); new RawDemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); } private static File getYamlFile() { Loading sharding-jdbc-example/raw-jdbc-example/src/main/java/io/shardingsphere/example/jdbc/main/orche/java/etcd/MasterSlaveOnly.java +2 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import io.shardingsphere.api.config.MasterSlaveRuleConfiguration; import io.shardingsphere.example.jdbc.util.DataSourceUtil; import io.shardingsphere.example.repository.jdbc.repository.RawOrderItemRepository; import io.shardingsphere.example.repository.jdbc.repository.RawOrderRepository; import io.shardingsphere.example.repository.jdbc.service.DemoService; import io.shardingsphere.example.repository.jdbc.service.RawDemoService; import io.shardingsphere.orchestration.config.OrchestrationConfiguration; import io.shardingsphere.orchestration.config.OrchestrationType; import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; Loading @@ -47,7 +47,7 @@ public class MasterSlaveOnly { public static void main(final String[] args) throws SQLException { DataSource dataSource = getDataSource(); new DemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); new RawDemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); ((OrchestrationMasterSlaveDataSource) dataSource).close(); } Loading sharding-jdbc-example/raw-jdbc-example/src/main/java/io/shardingsphere/example/jdbc/main/orche/java/zookeeper/MasterSlaveOnly.java +2 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import io.shardingsphere.api.config.MasterSlaveRuleConfiguration; import io.shardingsphere.example.jdbc.util.DataSourceUtil; import io.shardingsphere.example.repository.jdbc.repository.RawOrderItemRepository; import io.shardingsphere.example.repository.jdbc.repository.RawOrderRepository; import io.shardingsphere.example.repository.jdbc.service.DemoService; import io.shardingsphere.example.repository.jdbc.service.RawDemoService; import io.shardingsphere.orchestration.config.OrchestrationConfiguration; import io.shardingsphere.orchestration.config.OrchestrationType; import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; Loading Loading @@ -49,7 +49,7 @@ public class MasterSlaveOnly { public static void main(final String[] args) throws SQLException { DataSource dataSource = getDataSource(); new DemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); new RawDemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); ((OrchestrationMasterSlaveDataSource) dataSource).close(); } Loading sharding-jdbc-example/raw-jdbc-example/src/main/java/io/shardingsphere/example/jdbc/main/orche/yaml/etcd/MasterSlaveOnly.java +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ package io.shardingsphere.example.jdbc.main.orche.yaml.etcd; import io.shardingsphere.example.repository.jdbc.repository.RawOrderItemRepository; import io.shardingsphere.example.repository.jdbc.repository.RawOrderRepository; import io.shardingsphere.example.repository.jdbc.service.DemoService; import io.shardingsphere.example.repository.jdbc.service.RawDemoService; import io.shardingsphere.shardingjdbc.orchestration.api.yaml.YamlOrchestrationMasterSlaveDataSourceFactory; import io.shardingsphere.shardingjdbc.orchestration.internal.datasource.OrchestrationMasterSlaveDataSource; Loading @@ -32,7 +32,7 @@ public class MasterSlaveOnly { public static void main(final String[] args) throws Exception { DataSource dataSource = YamlOrchestrationMasterSlaveDataSourceFactory.createDataSource(getYamlFile()); new DemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); new RawDemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); ((OrchestrationMasterSlaveDataSource) dataSource).close(); } Loading Loading
sharding-jdbc-example/raw-jdbc-example/src/main/java/io/shardingsphere/example/jdbc/main/nodep/java/MasterSlaveOnly.java +2 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import io.shardingsphere.api.config.MasterSlaveRuleConfiguration; import io.shardingsphere.example.jdbc.util.DataSourceUtil; import io.shardingsphere.example.repository.jdbc.repository.RawOrderItemRepository; import io.shardingsphere.example.repository.jdbc.repository.RawOrderRepository; import io.shardingsphere.example.repository.jdbc.service.DemoService; import io.shardingsphere.example.repository.jdbc.service.RawDemoService; import io.shardingsphere.shardingjdbc.api.MasterSlaveDataSourceFactory; import javax.sql.DataSource; Loading @@ -39,7 +39,7 @@ public class MasterSlaveOnly { public static void main(final String[] args) throws SQLException { DataSource dataSource = getDataSource(); new DemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); new RawDemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); } private static DataSource getDataSource() throws SQLException { Loading
sharding-jdbc-example/raw-jdbc-example/src/main/java/io/shardingsphere/example/jdbc/main/nodep/yaml/MasterSlaveOnly.java +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ package io.shardingsphere.example.jdbc.main.nodep.yaml; import io.shardingsphere.example.repository.jdbc.repository.RawOrderItemRepository; import io.shardingsphere.example.repository.jdbc.repository.RawOrderRepository; import io.shardingsphere.example.repository.jdbc.service.DemoService; import io.shardingsphere.example.repository.jdbc.service.RawDemoService; import io.shardingsphere.shardingjdbc.api.yaml.YamlMasterSlaveDataSourceFactory; import javax.sql.DataSource; Loading @@ -32,7 +32,7 @@ public class MasterSlaveOnly { public static void main(final String[] args) throws Exception { DataSource dataSource = YamlMasterSlaveDataSourceFactory.createDataSource(getYamlFile()); new DemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); new RawDemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); } private static File getYamlFile() { Loading
sharding-jdbc-example/raw-jdbc-example/src/main/java/io/shardingsphere/example/jdbc/main/orche/java/etcd/MasterSlaveOnly.java +2 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import io.shardingsphere.api.config.MasterSlaveRuleConfiguration; import io.shardingsphere.example.jdbc.util.DataSourceUtil; import io.shardingsphere.example.repository.jdbc.repository.RawOrderItemRepository; import io.shardingsphere.example.repository.jdbc.repository.RawOrderRepository; import io.shardingsphere.example.repository.jdbc.service.DemoService; import io.shardingsphere.example.repository.jdbc.service.RawDemoService; import io.shardingsphere.orchestration.config.OrchestrationConfiguration; import io.shardingsphere.orchestration.config.OrchestrationType; import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; Loading @@ -47,7 +47,7 @@ public class MasterSlaveOnly { public static void main(final String[] args) throws SQLException { DataSource dataSource = getDataSource(); new DemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); new RawDemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); ((OrchestrationMasterSlaveDataSource) dataSource).close(); } Loading
sharding-jdbc-example/raw-jdbc-example/src/main/java/io/shardingsphere/example/jdbc/main/orche/java/zookeeper/MasterSlaveOnly.java +2 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import io.shardingsphere.api.config.MasterSlaveRuleConfiguration; import io.shardingsphere.example.jdbc.util.DataSourceUtil; import io.shardingsphere.example.repository.jdbc.repository.RawOrderItemRepository; import io.shardingsphere.example.repository.jdbc.repository.RawOrderRepository; import io.shardingsphere.example.repository.jdbc.service.DemoService; import io.shardingsphere.example.repository.jdbc.service.RawDemoService; import io.shardingsphere.orchestration.config.OrchestrationConfiguration; import io.shardingsphere.orchestration.config.OrchestrationType; import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; Loading Loading @@ -49,7 +49,7 @@ public class MasterSlaveOnly { public static void main(final String[] args) throws SQLException { DataSource dataSource = getDataSource(); new DemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); new RawDemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); ((OrchestrationMasterSlaveDataSource) dataSource).close(); } Loading
sharding-jdbc-example/raw-jdbc-example/src/main/java/io/shardingsphere/example/jdbc/main/orche/yaml/etcd/MasterSlaveOnly.java +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ package io.shardingsphere.example.jdbc.main.orche.yaml.etcd; import io.shardingsphere.example.repository.jdbc.repository.RawOrderItemRepository; import io.shardingsphere.example.repository.jdbc.repository.RawOrderRepository; import io.shardingsphere.example.repository.jdbc.service.DemoService; import io.shardingsphere.example.repository.jdbc.service.RawDemoService; import io.shardingsphere.shardingjdbc.orchestration.api.yaml.YamlOrchestrationMasterSlaveDataSourceFactory; import io.shardingsphere.shardingjdbc.orchestration.internal.datasource.OrchestrationMasterSlaveDataSource; Loading @@ -32,7 +32,7 @@ public class MasterSlaveOnly { public static void main(final String[] args) throws Exception { DataSource dataSource = YamlOrchestrationMasterSlaveDataSourceFactory.createDataSource(getYamlFile()); new DemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); new RawDemoService(new RawOrderRepository(dataSource), new RawOrderItemRepository(dataSource)).demo(); ((OrchestrationMasterSlaveDataSource) dataSource).close(); } Loading