📄 dormservice.java
字号:
package edu.yinhe.mis.services;
import java.sql.SQLException;
import java.util.ArrayList;
import edu.yinhe.mis.model.DAOFactory;
import edu.yinhe.mis.vo.DormVO;
import edu.yinhe.system.common.AppException;
import edu.yinhe.system.model.IBaseDAO;
import edu.yinhe.system.services.Service;
public class DormService extends Service{
private IBaseDAO DormDAO=null;
/**
* 查询所有信息
* @author 朱文兵
* @param 无传入值
* @return 返回一个ArrayList
* @exception SQLException
* creation date :04-30-2008
*/
public Object alllist() throws AppException {
return null;
}
public Object alllist(Object arg0) throws AppException {
// TODO Auto-generated method stub
return null;
}
public Object create(Object arg0) throws AppException {
// TODO Auto-generated method stub
return null;
}
public Object findAll() throws AppException {
ArrayList list=new ArrayList ();
DormDAO = DAOFactory.getDormDAO(conn);
try {
list = (ArrayList)DormDAO.findAll();
}catch (SQLException e) {
try {
conn.rollback();
} catch (SQLException e1) {
throw new AppException(e.getMessage()+"危险!");
}
}finally{
closeConnection();//注意,连接是在前面有服务层创建,本着谁创建,谁关闭的原则,所以要它关闭;
}
return list;
}
public Object findAll(Object arg0) throws AppException {
// TODO Auto-generated method stub
return null;
}
public Object findById(Object arg0) throws AppException {
// TODO Auto-generated method stub
return null;
}
/**
* 查询寝室以住和实住人员
* @author 朱文兵
* @param 传入寝室号
* @return 返回一个ArrayList
* @exception SQLException
* creation date :04-30-2008
*/
public Object findByObject(Object arg0) throws AppException {
DormVO vo= new DormVO();
DormDAO = DAOFactory.getDormFormDAO(conn);
try {
vo = (DormVO) DormDAO.findByObject(arg0);
}catch (SQLException e) {
try {
conn.rollback();
} catch (SQLException e1) {
throw new AppException(e.getMessage()+"危险!");
}
}finally{
closeConnection();//注意,连接是在前面有服务层创建,本着谁创建,谁关闭的原则,所以要它关闭;
}
return vo;
}
public int getcount() throws AppException {
// TODO Auto-generated method stub
return 0;
}
public int getcount(Object arg0) throws AppException {
// TODO Auto-generated method stub
return 0;
}
public Object list() throws AppException {
// TODO Auto-generated method stub
return null;
}
public Object list(Object arg0) throws AppException {
// TODO Auto-generated method stub
return null;
}
public Object load(Object arg0) throws AppException {
// TODO Auto-generated method stub
return null;
}
/**
* 修改寝室号
* @author 朱文兵
* @param 传入下面,和新寝室号
* @return 返回一个ArrayList
* @exception SQLException
* creation date :04-30-2008
*/
public Object modify(Object arg0) throws AppException {
Integer flag=0;
DormDAO = DAOFactory.getDormFormDAO(conn);
try {
flag = (Integer) DormDAO.update(arg0);
}catch (SQLException e) {
try {
conn.rollback();
} catch (SQLException e1) {
throw new AppException(e.getMessage()+"危险!");
}
}finally{
closeConnection();//注意,连接是在前面有服务层创建,本着谁创建,谁关闭的原则,所以要它关闭;
}
return flag;
}
public Object remove(Object arg0) throws AppException {
// TODO Auto-generated method stub
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -