{"id":36419862,"url":"https://github.com/unikueltd/multiple-datasource-spring-boot-starter","last_synced_at":"2026-01-14T02:57:29.015Z","repository":{"id":248999195,"uuid":"821691486","full_name":"unikueltd/multiple-datasource-spring-boot-starter","owner":"unikueltd","description":"Multiple datasource for spring boot starter","archived":false,"fork":false,"pushed_at":"2025-09-14T13:57:31.000Z","size":112,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"trunk","last_synced_at":"2026-01-11T18:45:22.957Z","etag":null,"topics":["database","datasource","spring-boot","spring-starter"],"latest_commit_sha":null,"homepage":"https://mvnrepository.com/artifact/com.yookue.springstarter/multiple-datasource-spring-boot-starter","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unikueltd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE.txt","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-29T06:56:04.000Z","updated_at":"2025-09-14T13:57:35.000Z","dependencies_parsed_at":"2025-02-02T13:37:14.477Z","dependency_job_id":"254ddf4e-4cb0-4170-80ee-71bb795b2600","html_url":"https://github.com/unikueltd/multiple-datasource-spring-boot-starter","commit_stats":null,"previous_names":["yookue/multiple-datasource-spring-boot-starter","unikueltd/multiple-datasource-spring-boot-starter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/unikueltd/multiple-datasource-spring-boot-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unikueltd%2Fmultiple-datasource-spring-boot-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unikueltd%2Fmultiple-datasource-spring-boot-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unikueltd%2Fmultiple-datasource-spring-boot-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unikueltd%2Fmultiple-datasource-spring-boot-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unikueltd","download_url":"https://codeload.github.com/unikueltd/multiple-datasource-spring-boot-starter/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unikueltd%2Fmultiple-datasource-spring-boot-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","datasource","spring-boot","spring-starter"],"created_at":"2026-01-11T17:05:28.706Z","updated_at":"2026-01-14T02:57:28.992Z","avatar_url":"https://github.com/unikueltd.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multiple Datasource Spring Boot Starter\n\nSpring Boot application integrates multiple `DataSource` quickly.\n\n## Quickstart\n\n- Import dependencies\n\n```xml\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecn.unikue.springstarter\u003c/groupId\u003e\n        \u003cartifactId\u003emultiple-datasource-spring-boot-starter\u003c/artifactId\u003e\n        \u003cversion\u003eLATEST\u003c/version\u003e\n    \u003c/dependency\u003e\n```\n\n\u003e By default, this starter will auto take effect, you can turn it off by `spring.multiple-datasource.enabled = false`\n\n- Configure Spring Boot `application.yml` with prefix `spring.multiple-datasource`\n\n```yml\nspring:\n    multiple-datasource:\n        primary:\n            url: 'jdbc:mysql://127.0.0.1:3306/test_db1'\n            driver-class-name: com.mysql.cj.jdbc.Driver\n            type: com.zaxxer.hikari.HikariDataSource\n            jpa-enabled: true\n            repository-enabled: true\n            mybatis:\n            xa:\n        secondary:\n            url: 'jdbc:mysql://127.0.0.1:3306/test_db2'\n            driver-class-name: com.mysql.cj.jdbc.Driver\n            type: com.mchange.v2.c3p0.ComboPooledDataSource\n            jpa-enabled: true\n            repository-enabled: true\n            mybatis:\n            xa:\n        tertiary:\n            url: 'jdbc:mysql://127.0.0.1:3306/test_db3'\n            driver-class-name: com.mysql.cj.jdbc.Driver\n            type: org.apache.commons.dbcp2.BasicDataSource\n            jpa-enabled: true\n            repository-enabled: true\n            mybatis:\n            xa:\n```\n\n\u003e This starter supports 3 `DataSource` at most. (Three strikes and you're out)\n\n- Locate your entities and repositories under the following packages (take `primary` as an example)\n\n    - Entities: `**.domain.primary.rdbms`\n    - Repositories: `**.repository.primary.rdbms`\n\n- Configure your beans with the following beans by `@Autowired`/`@Resource` annotation, combined with `@Qualifier` annotation (take `primary` as an example)\n\n| Bean Type              | Qualifier                                                  |\n|------------------------|------------------------------------------------------------|\n| DataSource             | PrimaryDataSourceJdbcConfiguration.DATA_SOURCE             |\n| JdbcTemplate           | PrimaryDataSourceJdbcConfiguration.JDBC_TEMPLATE           |\n| TransactionManager     | PrimaryDataSourceJdbcConfiguration.TRANSACTION_MANAGER     |\n| PersistenceUnitManager | PrimaryDataSourceJpaConfiguration.PERSISTENCE_UNIT         |\n| EntityManager          | PrimaryDataSourceJpaConfiguration.ENTITY_MANAGER           |\n| SqlSessionFactory      | PrimaryDataSourceMybatisConfiguration.SQL_SESSION_FACTORY  |\n| SqlSessionTemplate     | PrimaryDataSourceMybatisConfiguration.SQL_SESSION_TEMPLATE |\n\n- This starter supports the most popular data source pools in the world, including\n  - c3p0\n  - dbcp2\n  - druid\n  - hikari\n  - oracle ucp\n  - tomcat\n  - vibur\n\n## Document\n\n- Github: https://github.com/unikueltd/multiple-datasource-spring-boot-starter\n\n## Requirement\n\n- jdk 17+\n\n## License\n\nThis project is under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)\n\nSee the `NOTICE.txt` file for required notices and attributions.\n\n## Donation\n\nYou like this package? Then [donate to us](https://unikue.cn/donation) to support the development.\n\n## Copyright\n\nBeijing Unikue Network Technology Ltd.\n\n## Website\n\n- Unikue: https://unikue.cn\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funikueltd%2Fmultiple-datasource-spring-boot-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funikueltd%2Fmultiple-datasource-spring-boot-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funikueltd%2Fmultiple-datasource-spring-boot-starter/lists"}