当前位置:网站首页>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
边栏推荐
- Market layout planning and latest dynamic analysis report of China's smart public security industry Ⓕ 2022 ~ 2028
- [sg function] 2021 Niuke winter vacation training camp 6 h. winter messenger 2
- DR-AP40X9-A-Qualcomm-IPQ-4019-IPQ-4029-5G-4G-LTE-aluminum-body-dual-band-wifi-router-2.4GHZ-5GHz-QSD
- Supply and demand situation and market scale calculation report of China's portable energy storage power PES industry Ⓛ 2022 ~ 2028
- How to solve the problem of requiring a password when accessing your network neighborhood on your computer
- 2022 safety officer-a certificate registration examination and summary of safety officer-a certificate examination
- Pan Yueming helps Germany's Rochester Zodiac custom wristwatch
- Sow of PMP
- The 14th five year plan for the construction of Chinese Enterprise Universities and the feasibility study report on investment Ⓓ 2022 ~ 2028
- Development trend and market demand analysis report of China's energy storage battery industry Ⓩ 2022 ~ 2028
猜你喜欢

Programming language (1)
![[Android reverse] use DB browser to view and modify SQLite database (download DB browser installation package | install DB browser tool)](/img/1d/044e81258db86cf34eddd3b8f5cf90.jpg)
[Android reverse] use DB browser to view and modify SQLite database (download DB browser installation package | install DB browser tool)

2022 safety officer-a certificate registration examination and summary of safety officer-a certificate examination

Pooling idea: string constant pool, thread pool, database connection pool

1068. Consolidation of ring stones (ring, interval DP)

Unique in China! Alibaba cloud container service enters the Forrester leader quadrant

webAssembly

The latest analysis of crane driver (limited to bridge crane) in 2022 and the test questions and analysis of crane driver (limited to bridge crane)

Yyds dry goods inventory Spring Festival "make" your own fireworks
![Buuctf, web:[geek challenge 2019] buyflag](/img/02/d3add04f8145621bff35d46b82ba53.jpg)
Buuctf, web:[geek challenge 2019] buyflag
随机推荐
Bluebridge cup Guoxin Changtian single chip microcomputer -- hardware environment (I)
Covariance
1068. Consolidation of ring stones (ring, interval DP)
[Android reverse] use DB browser to view and modify SQLite database (download DB browser installation package | install DB browser tool)
How can enterprises and developers take advantage of the explosion of cloud native landing?
Overview of Yunxi database executor
Leetcode week 4: maximum sum of arrays (shape pressing DP bit operation)
Report on the development strategy of China's engineering bidding agency and suggestions for the 14th five year plan Ⓙ 2022 ~ 2028
China's coal industry investment strategic planning future production and marketing demand forecast report Ⓘ 2022 ~ 2028
Exclusive interview with the person in charge of openkruise: to what extent has cloud native application automation developed now?
Leetcode problem solving - 230 The k-th smallest element in the binary search tree
pivot ROP Emporium
[secretly kill little partner pytorch20 days] - [day3] - [example of text data modeling process]
Development trend and market demand analysis report of China's energy storage battery industry Ⓩ 2022 ~ 2028
[SRS] build a specified version of SRS
Is the account opening of Guotai Junan Securities safe and reliable? How to open Guotai Junan Securities Account
Cognitive fallacy: what is Fredkin's paradox
regular expression
Firefox set up proxy server
Cesium terrain clipping draw polygon clipping