当前位置:网站首页>Druids connect to mysql8.0.11
Druids connect to mysql8.0.11
2022-07-03 22:25:00 【zhang__ one thousand two hundred and thirty-four】
Public Key Retrieval is not allowed resolvent
allowPublicKeyRetrieval=true In the configuration file url Add later
Of course, this is just a way to connect , You can also write the tool class of the Druid connection pool to connect
@Test
public void testdurid() throws Exception {
//1. Join in Druid jar package
//2. Add profile druid.properties, Copy files to the src Catalog
//3. establish properties object Used to read configuration files
Properties properties = new Properties();
properties.load(new FileInputStream(("src\\druid.properties")));
//4. Create a database connection pool with specified parameters
DataSource dataSource = DruidDataSourceFactory.createDataSource(properties);
Connection connection = dataSource.getConnection();
System.out.println(" Successful connection ");
connection.close();
}
#key=value
driverClassName=com.mysql.cj.jdbc.Driver
url=jdbc:mysql://localhost:3306/hsp_db02?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true
#url=jdbc:mysql://localhost:3306/girls
username=root
password=root
#initial connection Size
initialSize=10
#min idle connecton size
minIdle=5
#max active connection size
maxActive=50
#max wait time (5000 mil seconds)
maxWait=5000
边栏推荐
- DR-AP40X9-A-Qualcomm-IPQ-4019-IPQ-4029-5G-4G-LTE-aluminum-body-dual-band-wifi-router-2.4GHZ-5GHz-QSD
- Is the account opening of Guotai Junan Securities safe and reliable? How to open Guotai Junan Securities Account
- Leetcode problem solving - 235 Nearest common ancestor of binary search tree
- On my first day at work, this API timeout optimization put me down!
- regular expression
- 2 spark environment setup local
- Exclusive interview with the person in charge of openkruise: to what extent has cloud native application automation developed now?
- Take you to master the formatter of visual studio code
- 油猴插件
- Bluebridge cup Guoxin Changtian single chip microcomputer -- hardware environment (I)
猜你喜欢

Data consistency between redis and database

6.0 kernel driver character driver

2022 safety officer-a certificate registration examination and summary of safety officer-a certificate examination
![Buuctf, web:[geek challenge 2019] buyflag](/img/02/d3add04f8145621bff35d46b82ba53.jpg)
Buuctf, web:[geek challenge 2019] buyflag

Niuke winter vacation training camp 4 g (enumeration optimization, Euler power reduction)

string

How to restore the factory settings of HP computer

Cesium terrain clipping draw polygon clipping

How can enterprises and developers take advantage of the explosion of cloud native landing?
![[dynamic programming] Ji Suan Ke: Suan tou Jun breaks through the barrier (variant of the longest increasing subsequence)](/img/6c/2d48d441fee1981a271319fd9f6c23.jpg)
[dynamic programming] Ji Suan Ke: Suan tou Jun breaks through the barrier (variant of the longest increasing subsequence)
随机推荐
Yyds dry goods inventory Spring Festival "make" your own fireworks
Report on the development status and investment planning trends of China's data center industry Ⓡ 2022 ~ 2028
Ansible common usage scenarios
Mysql database - Advanced SQL statement (I)
Take you to master the formatter of visual studio code
[sg function] lightoj Partitioning Game
1068. Consolidation of ring stones (ring, interval DP)
2022 safety officer-a certificate registration examination and summary of safety officer-a certificate examination
STM32 multi serial port implementation of printf -- Based on cubemx
[golang] leetcode intermediate - alphabetic combination of island number and phone number
webAssembly
China's Call Center Industry 14th five year plan direction and operation analysis report Ⓔ 2022 ~ 2028
[dynamic programming] Jisuan Ke: Jumping stake (variant of the longest increasing subsequence)
The reason why the computer runs slowly and how to solve it
Teach you how to run two or more MySQL databases at the same time in one system
(POJ - 2912) rochambau (weighted concurrent search + enumeration)
Report on the current situation and development trend of ethoxylated sodium alkyl sulfate industry in the world and China Ⓞ 2022 ~ 2027
Is the account opening of Guotai Junan Securities safe and reliable? How to open Guotai Junan Securities Account
Teach you to easily learn the type of data stored in the database (a must see for getting started with the database)
油猴插件