Home > Back-end >  Error springboot configuration is essentially a connection pool
Error springboot configuration is essentially a connection pool

Time:01-02

Pom. XML

<? The XML version="1.0" encoding="utf-8"?>
XMLNS: xsi="http://www.w3.org/2001/XMLSchema-instance"
Xsi: schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" & gt;
4.0.0 & lt;/modelVersion>

Org. Springframework. Boot
Spring - the boot - starter - parent
Against 2.4.1 & lt;/version>

Com. Example
DemoTestPj
0.0.1 - SNAPSHOT
DemoTestPj
The Demo project for Spring Boot


1.8 & lt;/Java. Version>




Org. Springframework. Boot
Spring - the boot - starter - web



Org. Springframework. Boot
Spring - the boot - devtools
Runtime
True


Org. Springframework. Boot
Spring - the boot - starter - test
Test


Com. Alibaba
Druid - spring - the boot - starter
1. & lt;/version>




Org. Springframework. Boot
Spring - the boot - starter - jdbc



Sqljdbc
Sqljdbc42 & lt;/artifactId>
4.2 & lt;/version>
System
C: \ eclipse - workspace2 \ DemoTestPj \ target \ BOOT - INF \ lib \ sqljdbc42 jar


Log4j & lt;/groupId>
Log4j & lt;/artifactId>
1.2.17 & lt;/version>








Org. Springframework. Boot
Spring - the boot - maven - plugin




Lib
The/BOOT - INF/lib/& lt;/targetPath>

/* * *. Jar








Application. The properties

Server port=7000

#==============================
# MySQL connection config
#==============================
Spring. The datasource. Url=JDBC: essentially://* * * * *; DatabaseName=HuanYuDB; IntegratedSecurity=false;
Spring. The datasource. The username=* * * * * *
Spring. The datasource. Password=* * * * * *
# spring. The datasource. The driver - class - name=com. Microsoft. Essentially. JDBC. SQLServerDriver
# Druid will automatically with a url to identify driver class name, if the database connection is not common database, configuration properties driverClassName
#==============================
Special # Druid data source configuration
#==============================
# initialization size, minimum, maximum
Spring. The datasource. The druid. Initial - size=3
Spring. The datasource. The druid. MinIdle=5
Spring. The datasource. The druid. MaxActive=20
# configuration access connection wait timeout time
Spring. The datasource. The druid. MaxWait=30000
# configuration interval how to conduct a test, test need to shut down the free connection, the unit is milliseconds
Spring. The datasource. The druid. TimeBetweenEvictionRunsMillis=60000
# to configure a connection in the pool minimum survival time, unit is a millisecond
Spring. The datasource. The druid. MinEvictableIdleTimeMillis=300000
Spring. The datasource. The druid. MaxEvictableIdleTimeMillis=900000
Spring. The datasource. The druid. ValidationQuery=SELECT 1 FROM DUAL
Spring. The datasource. The druid. TestWhileIdle=true
Spring. The datasource. The druid. TestOnBorrow=false
Spring. The datasource. The druid. TestOnReturn=false
Open PSCache #, and the size of the specified on each connection PSCache
Spring. The datasource. The druid. PoolPreparedStatements=true
Spring. The datasource. The druid. MaxPoolPreparedStatementPerConnectionSize=20
# configuration monitoring statistics of intercepting filters to remove after SQL is unable to statistics, monitoring interface used for firewall
'wall'Spring. The datasource. The druid filters=stat, wall, log4j
# by connectProperties attribute to open mergeSql function; Slow SQL record
# merge multiple DruidDataSource monitoring data
# spring. The datasource. UseGlobalDataSourceStat=true
# by connectProperties attribute to open mergeSql function; Slow SQL record
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related