当前位置:网站首页>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
边栏推荐
- [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)
- Pan Yueming helps Germany's Rochester Zodiac custom wristwatch
- Redis single thread and multi thread
- 320. Energy Necklace (ring, interval DP)
- Teach you to easily learn the type of data stored in the database (a must see for getting started with the database)
- Ansible common usage scenarios
- Ten minutes will take you in-depth understanding of multithreading. Multithreading on lock optimization (I)
- [automation operation and maintenance novice village] flask-2 certification
- JS demo calculate how many days are left in this year
- Is the account opening of Guotai Junan Securities safe and reliable? How to open Guotai Junan Securities Account
猜你喜欢
[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)
pivot ROP Emporium
Unique in China! Alibaba cloud container service enters the Forrester leader quadrant
Programming language (2)
Unique in China! Alibaba cloud container service enters the Forrester leader quadrant
1068. Consolidation of ring stones (ring, interval DP)
2022 safety officer-b certificate examination summary and safety officer-b certificate simulation test questions
Wisdom tooth technology announced that it had completed the round D financing of US $100million and had not obtained a valid patent yet
4 environment construction -standalone ha
The reason why the computer runs slowly and how to solve it
随机推荐
Leetcode: a single element in an ordered array
2022 high altitude installation, maintenance and removal of examination question bank and high altitude installation, maintenance and removal of examination papers
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
Leetcode problem solving - 235 Nearest common ancestor of binary search tree
AST (Abstract Syntax Tree)
WFC900M-Network_ Card/Qualcomm-Atheros-AR9582-2T-2R-MIMO-802.11-N-900M-high-power-Mini-PCIe-Wi-Fi-Mod
Analysis report on the development prospect and investment strategy of global and Chinese modular automation systems Ⓟ 2022 ~ 2027
China HDI market production and marketing demand and investment forecast analysis report Ⓢ 2022 ~ 2028
Control loop of program (while loop)
Kali2021.4a build PWN environment
Getting started with DOM
STM32 multi serial port implementation of printf -- Based on cubemx
Investment planning analysis and prospect prediction report of China's satellite application industry during the 14th five year plan Ⓑ 2022 ~ 2028
js demo 计算本年度还剩下多少天
Dynamic research and future planning analysis report of China's urban water supply industry Ⓝ 2022 ~ 2028
Cognitive fallacy: what is Fredkin's paradox
Mindmanager2022 serial number key decompression installer tutorial
Buuctf, web:[geek challenge 2019] buyflag
Can you draw with turtle?
Sed、Awk