C++开发工程师基础进阶课程-夯实C++基础核心内容
2023-08-21 09:51 作者:每天3个拼课小技巧__ | 我要投稿
/**
* 获取连接池对象
* @return
*/
public static DataSource getDataSource(){
return dataSource;
}
/**
* 获取连接
* @return
*/
public static Connection getConnection(){
try {
return dataSource.getConnection();
} catch (SQLException e) {
e.printStackTrace();
// 运行时发生异常再抛出一场
throw new RuntimeException(e.getMessage());
}
}