From 2c46f58820cdbefe61ab9258518aabee4b28047f Mon Sep 17 00:00:00 2001 From: Balaji <104271023+tbalaji0001@users.noreply.github.com> Date: Mon, 18 Mar 2024 09:44:03 +0530 Subject: [PATCH] DataSource Config added For Petition Master, Mayor Petition and Councillor Petition --- .DS_Store | Bin 8196 -> 8196 bytes src/.DS_Store | Bin 6148 -> 6148 bytes src/main/.DS_Store | Bin 6148 -> 6148 bytes src/main/java/.DS_Store | Bin 6148 -> 6148 bytes src/main/java/in/.DS_Store | Bin 6148 -> 6148 bytes src/main/java/in/gov/.DS_Store | Bin 6148 -> 6148 bytes .../java/in/gov/chennaicorporation/.DS_Store | Bin 6148 -> 6148 bytes .../chennaicorporation/gccoffice/.DS_Store | Bin 8196 -> 10244 bytes .../configuration/DataSourceConfig.java | 45 +++++++++++++++--- 9 files changed, 39 insertions(+), 6 deletions(-) diff --git a/.DS_Store b/.DS_Store index ce801bf841f39dda057b7af7a6874f04bbd31567..d9d1b8b84397cf484eec3e83f60c4f7e60e6aa21 100644 GIT binary patch delta 16 XcmZp1XmQveDKdG!=&H?!MI5;SHmL?J delta 24 gcmZp1XmQveDZvYH diff --git a/src/main/java/in/gov/.DS_Store b/src/main/java/in/gov/.DS_Store index 8ab49841b7e2984c76232302239da00a3d6d304f..f25257e0bb09619018a16f181fb31a90bb6fcd59 100644 GIT binary patch delta 20 bcmZoMXffFEgNfb9(o9Fe!esM*CRR}ZNInKZ delta 20 bcmZoMXffFEgNfbP)KW*m$aM36CRR}ZNEik@ diff --git a/src/main/java/in/gov/chennaicorporation/.DS_Store b/src/main/java/in/gov/chennaicorporation/.DS_Store index 4daeee73b620ff0b181ca51a0a4632ecea64f2a7..f1d1ab25326c65fd5e92bd19b0b0121fe2e36bea 100644 GIT binary patch delta 20 bcmZoMXffDug^AtB(o9Fe!esMpCQVTQMcM`( delta 20 bcmZoMXffDug^AtR)KW*m$aM2< z`@{y`&Fma39Ht-@Tnxz!@eBnFsmQ84bMljua`KZv#xXE3r32}C|G|KPVKR?^?PPud z>B-v!8`zC3&2$tjOeWh3Ie^8U3-fRG6fkAc zi121+F&3tc4QXtG%s_b{P~Zj)5 zPGg_gz`L29gN1`pe6oXp?c}|JqMPRlDzHpe5fk3bDptq1d8POdMnPtvb|8@81`@6y hV>cFlXP(Tj6378G6l5900szO79j*WX diff --git a/src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java b/src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java index b228faa..cb3c581 100644 --- a/src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java +++ b/src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java @@ -23,6 +23,7 @@ import java.util.Properties; @EnableTransactionManagement public class DataSourceConfig { + //////////////////////////////(For GCC APP) //////////////////////// @Configuration @EnableTransactionManagement @EnableJpaRepositories( @@ -69,6 +70,7 @@ public class DataSourceConfig { } } + //////////////////////////////(For Tax Collection 1913) //////////////////////// @Configuration @EnableTransactionManagement @EnableJpaRepositories( @@ -86,12 +88,7 @@ public class DataSourceConfig { dataSource.setPassword(""); return dataSource; } -/* - @Bean(name = "mysqlTaxCollectionJdbcTemplate") - public JdbcTemplate mysqlTaxCollectionJdbcTemplate(@Qualifier("mysqlTaxCollectionDataSource") DataSource dataSource) { - return new JdbcTemplate(dataSource); - } -*/ + @Bean(name="taxEntityManagerFactory") public LocalContainerEntityManagerFactoryBean taxEntityManagerFactory( @Qualifier("mysqlTaxCollectionDataSource") DataSource dataSource) { @@ -112,6 +109,42 @@ public class DataSourceConfig { } } + + + //////////////////////////////(For Mayor Petition) //////////////////////// + @Bean(name = "mysqlMayorPetitionDataSource") + public DataSource mysqlMayorPetitionDataSource() { + DriverManagerDataSource dataSource = new DriverManagerDataSource(); + dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); + dataSource.setUrl("jdbc:mysql://localhost:3306/mayor_petition"); + dataSource.setUsername("root"); + dataSource.setPassword(""); + return dataSource; + } + + //////////////////////////////(For Petition Master) //////////////////////// + @Bean(name = "mysqlPetitionMasterDataSource") + public DataSource mysqlPetitionMasterDataSource() { + DriverManagerDataSource dataSource = new DriverManagerDataSource(); + dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); + dataSource.setUrl("jdbc:mysql://localhost:3306/petition_master"); + dataSource.setUsername("root"); + dataSource.setPassword(""); + return dataSource; + } + + //////////////////////////////(For Councillor Petition) //////////////////////// + @Bean(name = "mysqlCouncillorPetitionDataSource") + public DataSource mysqlCouncillorPetitionDataSource() { + DriverManagerDataSource dataSource = new DriverManagerDataSource(); + dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); + dataSource.setUrl("jdbc:mysql://localhost:3306/councillor_petition"); + dataSource.setUsername("root"); + dataSource.setPassword(""); + return dataSource; + } + + ////////////////////////////// ORACLE //////////////////////// @Bean(name = "oracleDataSource") public DataSource oracleDataSource() { DriverManagerDataSource dataSource = new DriverManagerDataSource();