当前位置:网站首页>Define the data source of hikaricp connection pool for bee
Define the data source of hikaricp connection pool for bee
2022-06-22 08:11:00 【abckingaa】
The database driver for the example is MySQL, The connection pool is HikariCP, It can be replaced with other database drivers and connection pools .
Map<String, DataSource> dataSourceMap = new HashMap<>();
// Configure the 1 Data sources
HikariDataSource dataSource1 = new HikariDataSource();
dataSource1.setDriverClassName("com.mysql.jdbc.Driver");
dataSource1.setJdbcUrl("jdbc:mysql://localhost:3306/ds_1");
dataSource1.setUsername("root");
dataSource1.setPassword("");
dataSourceMap.put("ds1", dataSource1);
// Configure the 2 Data sources
HikariDataSource dataSource2 = new HikariDataSource();
dataSource2.setDriverClassName("com.mysql.jdbc.Driver");
dataSource2.setJdbcUrl("jdbc:mysql://localhost:3306/ds_2");
dataSource2.setUsername("root");
dataSource2.setPassword("");
dataSourceMap.put("ds2", dataSource2);Then use the following statement , It can be ORM frame Bee Set up multiple data sources .
BeeFactory.getInstance().setDataSourceMap(dataSourceMap);
边栏推荐
- How Navicat queries the password information of the connected database
- Docker install redis
- DTD constraints
- The solution to the problem of the first screen picture loading flicker
- QT custom composite control (class promotion function)
- MySQL query group by 1055 is the simplest and most convenient way to solve the problem perfectly
- QT combox的使用示例
- Example of using listagg in Oracle 11g (splicing the values of a field into a line, separated by commas)
- [songhongkang MySQL database] [advanced chapter] [07] MySQL storage engine
- Mt4/mql4 getting started to mastering EA tutorial lesson 8 - common functions of MQL language (VIII) - common time function
猜你喜欢
![[songhongkang MySQL database] [advanced chapter] [07] MySQL storage engine](/img/47/62ad1e661e015438c40574f533d8f1.png)
[songhongkang MySQL database] [advanced chapter] [07] MySQL storage engine

Use of keepalived high availability cluster

MySQL master-slave replication

The significance of code coverage testing to programming white and its application

MySQL transactions

It operation and maintenance knowledge map

QT 自定义组合控件(类提升功能)

What is distributed transaction

Kubernetes practice

Expérience électrique en mode - - expérience 2 circuit d'amplification de source commune JFET
随机推荐
Seven challenges faced by CIO in 2022 and Solutions
It operation and maintenance knowledge map
The jdbcurl is configured correctly in the project, but the jdbcurl is the wrong path after the project is started
0基础自学stm32(野火)——什么是寄存器?
计算天数()
【Oracle 数据库】奶妈式教程day15 DDL、DML、索引、视图、序列、死锁这一篇就够了
.net core 技术栈 网站收集
Mt4/mql4 getting started to be proficient in EA tutorial lesson 7 - common functions of MQL language (VII) - index value taking function
MySQL queries data within one hour
XMIND 2022 mind map active resources?
(8) Sequence stack and chain stack
[Oracle database] mammy tutorial Day11 numerical function
方阵循环右移
Characteristics of industrial Internet
模板代码概述
MySQL transactions
MySQL query group by 1055 is the simplest and most convenient way to solve the problem perfectly
力扣(LeetCode)172. 阶乘后的零(2022.06.21)
Example of QT combox
LVS Technology Practice