当前位置:网站首页>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
边栏推荐
- The overseas listing of Shangmei group received feedback, and brands such as Han Shu and Yiye have been notified for many times and received attention
- Yyds dry goods inventory hands-on teach you to create a jigsaw puzzle using the canvasapi
- Kali2021.4a build PWN environment
- Rest参考
- Conditional statements of shell programming
- Cognitive fallacy: what is dimensional curse
- The 14th five year plan for the construction of Chinese Enterprise Universities and the feasibility study report on investment Ⓓ 2022 ~ 2028
- [automation operation and maintenance novice village] flask-2 certification
- Is the account opening of Guotai Junan Securities safe and reliable? How to open Guotai Junan Securities Account
- User login function: simple but difficult
猜你喜欢

2022 free examination questions for safety management personnel of hazardous chemical business units and reexamination examination for safety management personnel of hazardous chemical business units

Team collaborative combat penetration tool CS artifact cobalt strike

How to solve win10 black screen with only mouse arrow

Data consistency between redis and database

Niuke winter vacation training camp 4 g (enumeration optimization, Euler power reduction)
![[actual combat record] record the whole process of the server being attacked (redis vulnerability)](/img/9c/34b916aca2f9270ec4cf4651f0de7e.jpg)
[actual combat record] record the whole process of the server being attacked (redis vulnerability)

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

The latest analysis of R1 quick opening pressure vessel operation in 2022 and the examination question bank of R1 quick opening pressure vessel operation

BUUCTF,Misc:LSB

Cesium terrain clipping draw polygon clipping
随机推荐
Go language slice interview real question 7 consecutive questions
2 spark environment setup local
Preliminary analysis of smart microwave radar module
The reason why the computer runs slowly and how to solve it
6.2 normalization 6.2.5 third normal form (3NF)
How can enterprises and developers take advantage of the explosion of cloud native landing?
[Android reverse] use the DB browser to view and modify the SQLite database (copy the database file from the Android application data directory | use the DB browser tool to view the data block file)
Analysis report on the development trend and Prospect of global and Chinese supercontinuum laser source industry Ⓚ 2022 ~ 2027
2022 safety officer-a certificate registration examination and summary of safety officer-a certificate examination
Is it safe and reliable to open an account and register for stock speculation? Is there any risk?
Team collaborative combat penetration tool CS artifact cobalt strike
Niuke winter vacation training camp 4 g (enumeration optimization, Euler power reduction)
[dynamic programming] Ji Suan Ke: Suan tou Jun breaks through the barrier (variant of the longest increasing subsequence)
Codeforces Round #768 (Div. 1)(A-C)
Can you draw with turtle?
2022 high altitude installation, maintenance and removal of examination question bank and high altitude installation, maintenance and removal of examination papers
How can enterprises and developers take advantage of the explosion of cloud native landing?
Report on the development strategy of China's engineering bidding agency and suggestions for the 14th five year plan Ⓙ 2022 ~ 2028
Pooling idea: string constant pool, thread pool, database connection pool
On my first day at work, this API timeout optimization put me down!