当前位置:网站首页>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
边栏推荐
- Farmersworld farmers world, no faith, how to talk about success?
- Miscellaneous things that don't miss the right business
- Electronic tube: Literature Research on basic characteristics of 6j1
- Supply and demand situation and market scale calculation report of China's portable energy storage power PES industry Ⓛ 2022 ~ 2028
- Code in keil5 -- use the code formatting tool astyle (plug-in)
- Firefox set up proxy server
- Buuctf, misc: n solutions
- Codeforces Round #768 (Div. 1)(A-C)
- [SRS] build a specified version of SRS
- Getting started with DOM
猜你喜欢

On my first day at work, this API timeout optimization put me down!

Preliminary analysis of smart microwave radar module

6.0 kernel driver character driver

Introduction to kubernetes

Overview of Yunxi database executor

Programming language (1)

4 environment construction -standalone ha

Farmersworld farmers world, no faith, how to talk about success?
![[SRS] build a specified version of SRS](/img/01/0d2d762e01b304220b8924d20277e3.jpg)
[SRS] build a specified version of SRS

How to solve win10 black screen with only mouse arrow
随机推荐
Blue Bridge Cup Guoxin Changtian MCU -- program download (III)
In 2022, 6G development has indeed warmed up
油猴插件
Redis single thread and multi thread
Getting started with DOM
[dynamic programming] Jisuan Ke: Jumping stake (variant of the longest increasing subsequence)
LeetCode 1646. Get the maximum value in the generated array
Pooling idea: string constant pool, thread pool, database connection pool
How to switch between dual graphics cards of notebook computer
Introduction to kubernetes
Awk getting started to proficient series - awk quick start
2022 safety officer-a certificate registration examination and summary of safety officer-a certificate examination
Unique in China! Alibaba cloud container service enters the Forrester leader quadrant
Plug - in Oil Monkey
Pat grade A - 1164 good in C (20 points)
Wisdom tooth technology announced that it had completed the round D financing of US $100million and had not obtained a valid patent yet
What are the common computer problems and solutions
How can enterprises and developers take advantage of the explosion of cloud native landing?
Cognitive fallacy: what is Fredkin's paradox
Programming language (1)