1 查看當(dāng)前連接池的信息
import javax.sql.DataSource;
@RestController
@SpringBootApplication
public class HsellApplication implements CommandLineRunner {
@Autowired
DataSource dataSource;
public static void main(String[] args) {
SpringApplication.run(HsellApplication.class, args);
}
@Override
public void run(String... strings) throws Exception {
System.out.println("DATASOURCE = " + dataSource);
}
}
控制臺(tái)信息:
dataSource = {HikariDataSource@10070} "HikariDataSource (HikariPool-1)"
isShutdown = {AtomicBoolean@10083} "false"
fastPathPool = null
pool = {HikariPool@10084} "HikariPool-1"
connectionTimeout = 30000
validationTimeout = 5000
idleTimeout = 600000
leakDetectionThreshold = 0
maxLifetime = 1800000
maxPoolSize = 10
minIdle = 10
username = "root"
password = "GouhuotongZDZ123"
initializationFailTimeout = 1
catalog = null
connectionInitSql = null
connectionTestQuery = null
dataSourceClassName = null
dataSourceJndiName = null
driverClassName = "com.mysql.jdbc.Driver"
jdbcUrl = "jdbc:mysql://xx.xx/hsell?characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai"
poolName = "HikariPool-1"
schema = null
transactionIsolationName = null
isAutoCommit = true
isReadOnly = false
isIsolateInternalQueries = false
isRegisterMbeans = false
isAllowPoolSuspension = false
dataSource = null
dataSourceProperties = {Properties@10090} size = 0
threadFactory = null
scheduledExecutor = null
metricsTrackerFactory = null
metricRegistry = null
healthCheckRegistry = null
healthCheckProperties = {Properties@10091} size = 0
sealed = true
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者