properties = new HashMap<>();mysql
properties.put("driverClassName", "com.mysql.jdbc.Driver");//驱动方式sql
properties.put("validationQuery", "select 1");//心跳检测语句数据库
properties.put("maxTotal", "30");//最大30缓存
properties.put("minIdle", "2");//最小空闲链接数日志
properties.put("maxIdle", "10");//最大空闲链接数对象
properties.put("maxWaitMillis", "10000");//最大等待时间rem
properties.put("testOnBorrow", "false");//true 表示取链接发送一次心跳检测it
properties.put("testOnReturn", "false");//true 表示链接放回链接此发送一次心跳检测io
properties.put("testWhileIdle", "false");//true 空闲时候心跳检测table
properties.put("removeAbandonedOnBorrow", "false");// true 获取链接时判断当时是否有超时的链接并强制回收放回链接池
properties.put("removeAbandonedOnMaintenance", "true");//ture 空闲是判断当时是否有超时的链接并强制回收放回链接池
properties.put("removeAbandonedTimeout", "30");//链接超时时间
properties.put("logAbandoned", "true");//强制回收链接是否打印日志
properties.put("timeBetweenEvictionRunsMillis", "30000");//空闲心跳检测时间
properties.put("softMinEvictableIdleTimeMillis", "60000");//链接池中链接空闲时长超过该时长则强制关闭链接,单链接小于等于最小空闲链接数则不强制关闭
//properties.put("minEvictableIdleTimeMillis", "60000");//链接池中链接空闲时长超过该时长则强制关闭链接,会所有关闭链接 故通常不设
properties.put("logExpiredConnections", "false");//softMinEvictableIdleTimeMillis该设置触发是否打印日志
properties.put("poolPreparedStatements", "false");//true 缓存jdbc PreparedStatement对象
properties.put("defaultAutoCommit", "false");//默认是否自动提交,每次数据库操做都会提交,注意和enableAutoCommitOnReturn参数的差异
properties.put("enableAutoCommitOnReturn", "true");//true 链接放回链接池的时候提交
properties.put("rollbackOnReturn", "true");//true 放回链接池时候回滚,主要是针对数据库没有commit时候回滚数据