使用struts,ibaits和JSTL开发简便通用的文件上传系统(6)
2008-01-05 08:07:51 来源:WEB开发网核心提示:使用struts,ibaits和JSTL开发简便通用的文件上传系统(6) 下一小就是建立数据操作层的类代码 /* * Created on 2003-10-11 * * To change the template for this generated fi
使用struts,ibaits和JSTL开发简便通用的文件上传系统(6)
下一小就是建立数据操作层的类代码
/*
* Created on 2003-10-11
*
* To change the template for this generated file go to
* Window - PReferences - java - Code Generation - Code and Comments
*/
package com.ewuxi.champion.persistence.dao;
import java.util.HashMap;
import java.util.List;
import com.ewuxi.champion.exception.DaoException;
import com.ibatis.db.sqlmap.SqlMap;
/**
* @author champion
*
*attachment数据库操作对象
*/
public class AttachDb {
/**
* @param vo
* @throws DaoException
* 插入一条记录
*/
public void insert(HashMap vo) throws DaoException {
try {
SqlMap sqlMap = DaoCommon.getSqlMap(DaoCommon.getDefautDao());
sqlMap.executeUpdate("insertattachmentDao", vo);
} catch (Exception e) {
throw new DaoException(e);
}
}
/**
* @param vo
* @throws DaoException
* 删除一条记录
*/
public void delete(HashMap vo) throws DaoException {
try {
SqlMap sqlMap = DaoCommon.getSqlMap(DaoCommon.getDefautDao());
sqlMap.executeUpdate("deleteByPrimaryKeyattachmentDao", vo);
} catch (Exception e) {
throw new DaoException(e);
}
}
/**
* @param vo
* @throws DaoException
* 修改一条记录
*/
public void update(HashMap vo) throws DaoException {
try {
SqlMap sqlMap = DaoCommon.getSqlMap(DaoCommon.getDefautDao());
sqlMap.executeUpdate("updateByPrimaryKeyattachmentDao", vo);
} catch (Exception e) {
throw new DaoException(e);
}
}
/**
* @param vo
* @return
* @throws DaoException
* 查找一条记录
*/
public HashMap findByPk(HashMap vo) throws DaoException {
try {
SqlMap sqlMap = DaoCommon.getSqlMap(DaoCommon.getDefautDao());
return (HashMap) sqlMap.executeQueryForObject(
"findByPrimaryKeyattachmentDao",
vo);
} catch (Exception e) {
更多精彩
赞助商链接