当前位置:网站首页>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
边栏推荐
- Uboot migration
- QGIS grid processing DEM data reclassification
- 2022 electrician (elementary) examination questions and electrician (elementary) registration examination
- LeetCode 1646. Get the maximum value in the generated array
- [secretly kill little partner pytorch20 days] - [day3] - [example of text data modeling process]
- How the computer flushes the local DNS cache
- How to connect a laptop to a projector
- Market layout planning and latest dynamic analysis report of China's smart public security industry Ⓕ 2022 ~ 2028
- How to restore the factory settings of HP computer
- 320. Energy Necklace (ring, interval DP)
猜你喜欢

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

Harbor integrated LDAP authentication

How to connect a laptop to a projector

Summary of basic knowledge of exception handling

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

2 spark environment setup local

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

QGIS grid processing DEM data reclassification

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

Asynchronous artifact: implementation principle and usage scenario of completable future
随机推荐
Pan Yueming helps Germany's Rochester Zodiac custom wristwatch
Asynchronous artifact: implementation principle and usage scenario of completable future
油猴插件
540. Single element in ordered array
string
In 2022, 6G development has indeed warmed up
Bluebridge cup Guoxin Changtian single chip microcomputer -- hardware environment (I)
[sg function] 2021 Niuke winter vacation training camp 6 h. winter messenger 2
China HDI market production and marketing demand and investment forecast analysis report Ⓢ 2022 ~ 2028
6.2 normalization 6.2.5 third normal form (3NF)
How to connect a laptop to a projector
Development mode and Prospect of China's IT training industry strategic planning trend report Ⓣ 2022 ~ 2028
How to solve the problem of requiring a password when accessing your network neighborhood on your computer
Codeforces Round #768 (Div. 1)(A-C)
[sg function]split game (2020 Jiangxi university student programming competition)
Mindmanager2022 serial number key decompression installer tutorial
The latest analysis of R1 quick opening pressure vessel operation in 2022 and the examination question bank of R1 quick opening pressure vessel operation
Programming language (1)
Go language slice interview real question 7 consecutive questions
Ansible common usage scenarios