📄 connectionpoolconfig.java
字号:
package com.test.dao.pool;
public class ConnectionPoolConfig {
private String driver = "org.gjt.mm.mysql.Driver"; // 数据库驱动程序
private String url = "jdbc:mysql://192.168.1.56:3306/query_db"; // 数据连接的URL
private String user = "root"; // 数据库用户名
private String password = "1412"; // 数据库密码
private int minConnection = 5; // 初始化连接数
private int maxConnection = 50; // 最大连接数
private long timeoutValue = 600000;// 连接的最大空闲时间(10分钟)
private long waitTime = 10000; // 取连接的时候如果没有可用连接最大的等待时间
/**
* 使用默认参数构造
*/
public ConnectionPoolConfig(){
}
public ConnectionPoolConfig(String driver,String url,String user,String password
,int minConnection,int maxConnection,long timeoutValue,long waitTime){
this.driver = driver;
this.url = url;
this.user = user;
this.password = password;
this.minConnection = minConnection;
this.maxConnection = maxConnection;
this.timeoutValue = timeoutValue;
this.waitTime = waitTime;
}
public String getDriver() {
return driver;
}
public void setDriver(String driver) {
this.driver = driver;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public int getMinConnection() {
return minConnection;
}
public void setMinConnection(int minConnection) {
this.minConnection = minConnection;
}
public int getMaxConnection() {
return maxConnection;
}
public void setMaxConnection(int maxConnection) {
this.maxConnection = maxConnection;
}
public long getTimeoutValue() {
return timeoutValue;
}
public void setTimeoutValue(long timeoutValue) {
this.timeoutValue = timeoutValue;
}
public long getWaitTime() {
return waitTime;
}
public void setWaitTime(long waitTime) {
this.waitTime = waitTime;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -