62,615
社区成员
发帖
与我相关
我的任务
分享
private static ThreadLocal<Connection> connectionHolder
= new ThreadLocal<Connection>() {
public Connection initialValue() {
return DriverManager.getConnection(DB_URL);
}
};
public static Connection getConnection() {
return connectionHolder.get();
}
public static Connection getConnection() {
return DriverManager.getConnection(DB_URL);
}