import java.sql.Connection;
import javax.sql.DataSource;
import com.mchange.v2.c3p0.ComboPooledDataSource;
public class DaoUtil {
private static DataSource source = new ComboPooledDataSource();
private DaoUtil(){}
public static DataSource getSource(){
return source;
}
public static Connection getConnection(){
try {
return source.getConnection();
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
}
DaoUtil
最新推荐文章于 2023-06-14 22:09:58 发布