?? adminfreezdaccount.java
字號:
/*
* Created on 2005-7-26
*
*/
package banksystem.business;
/**
* @author 曲本盛
*
* TODO Struts 項目實踐
*/
import javax.sql.*;
import java.sql.*;
import banksystem.Constants;
public class AdminFreezdAccount {
/**
* @param dataSource 數據源.
* @param gene 查詢語句生成器.
*/
public void setAccountStatus(DataSource dataSource,SearchGene gene)throws SQLException,Exception{
Connection con = null;
PreparedStatement stat = null;
try{
con= dataSource.getConnection();
stat = con.prepareStatement(gene.getFreezedUpdateStr());
int rows = stat.executeUpdate();
if(rows==0){
throw new SQLException(Constants.UPDATE_FAILED);
}
}
catch(SQLException e){
throw e;
}
catch(Exception e){
throw e;
}
finally{
try{
if(con!=null){
con.close();
}
if(stat!=null){
stat.close();
}
}
catch(SQLException e){
throw new SQLException(e.getMessage());
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -