当前位置:网站首页>Pure white tutorial using Druid database connection pool in idea
Pure white tutorial using Druid database connection pool in idea
2022-07-24 05:26:00 【Xinxin vegetation】
1. download druid Related documents
Official download website https://repo1.maven.org/maven2/com/alibaba/druid/1.2.6/
Download these three jar After the document , Put three files in the same folder 

Add : What is? jar file ?
In the field of software ,JAR file (Java file , English :Java ARchive) Is a package file format , Usually used to aggregate a large number of Java Class file 、 Related metadata and resources ( Text 、 Pictures, etc ) File to a file , To distribute Java Platform applications or libraries .
2. stay idea Import druid and mysql

Left click druid-1.2.6jar file , Choose ,ctrl+c Key Copy .
With jdbc_demo Module as an example .
Right click jdbc_demo, Click New , Click on the table of contents , Name it lib, determine .
Left click lib Catalog 
Press ctrl+v Realization Paste 
Click ok 
You can see this jar Documents and in lib Inside the folder .
then
Right click druid-1.2.6jar, Click Add to Library ( The last line )
In the same way , take mysql-connector-java-8.0.29 Import and add to the Library
The premise is that you downloaded mysql 了 .
mysql Please search the tutorial separately for the installation configuration of .
Recommend a software ,everythingeverything Download address You can quickly find the desired file and get the location address 
3. To configure
stay src New file in , Name it druid.properties
stay druid.properties Paste the following code into the file
#druid File configuration ,MySQL edition 8.0.29,druid edition 1.2.6//
driverClassName = com.mysql.cj.jdbc.Driver
# Fill in your own database name in the database name below ,password Fill in your own database password
#url = jdbc:mysql://localhost:3306/ Database name ?useUnicode=true&characterEncoding=utf-8&userSSL=false&serverTimezone=GMT%2B8
url=jdbc:mysql://localhost:3306/datebase2?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=CONVERT_TO_NULL&allowPublicKeyRetrieval=true
username=root
password=*******
# Number of initial connections
initialSize = 5
# maximum connection
maxActive = 10
# Maximum timeout
maxWait = 3000
complete
边栏推荐
猜你喜欢
随机推荐
T 11-20
C table data De duplication
C语言入门篇 五.初识指针 六.初识结构体
【dp】数字三角形
反射
What are the core strengths of a knowledge base that supports customers quickly?
MySQL 远程连接错误解决方法
深度剖析数据在内存中的存储
C语言进阶篇 二. 指针
Machine vision learning summary
关于numpy基础用法的一个整理
JSP+Dao整合
使用swagger2markup生成API文档
【Pytorch】Dataset_DataLoader
String的字符串常量池和intern()详解
C语言从入门到入土——操作符超详细总结
Generics and annotations
C语言进阶篇 六.文件的操作
BeanShell built-in variable CTX
Sorting out some common server instructions and some binding instructions in csgo







![Embedded system transplantation [2] - Construction of cross development environment](/img/96/8d209c04e41675fc0efaa872c35615.png)

