conn用不用释放
public static Connection getConnection() throws Exception{
if(conn==null){
conn=DriverManager.getConnection(url, name, pass);
return conn;
当DAO层用单例模式获取conn以后 用不用释放资源
public static Connection getConnection() throws Exception{
if(conn==null){
conn=DriverManager.getConnection(url, name, pass);
return conn;
当DAO层用单例模式获取conn以后 用不用释放资源
2017-03-12
举报