2021
10-15
10-15
Hikari连接池使用SpringBoot配置JMX监控实现
Hikari是SpringBoot默认的数据库连接池。区别于C3P0直接通过连接池对象获取各项状态指标,Hikari需要通过JMX来获取。Demo如下,采用SpringBoot集成,定时采集连接状态。publicstaticvoidmain(String[]args)throwsSQLException,MalformedObjectNameException,InterruptedException{SpringApplication.run(HikariTest.class,args);HikariDataSourcehikaridatasource=newHikariDataSource();hikaridatasource.setJ...
继续阅读 >