使用struts,ibaits和JSTL开发简便通用的文件上传系统(6)
2008-01-05 08:07:51 来源:WEB开发网 闂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸绾惧綊鏌熼梻瀵割槮缁惧墽鎳撻—鍐偓锝庝簻椤掋垺銇勯幇顖毿撻柟渚垮妼椤粓宕卞Δ鈧獮濠勭磽閸屾艾鈧懓顫濋妸鈺佺疅缂佸顑欓崥瀣煕椤愵偅绶氱紓鍐╂礋濮婂宕掑▎鎴М濠电姭鍋撻梺顒€绉甸幆鐐哄箹濞n剙濡肩紒鎰殜閺屸€愁吋鎼粹€茬敖婵炴垶鎸哥粔鐢稿Φ閸曨垰鍐€妞ゆ劦婢€濞岊亪姊虹紒妯诲蔼闁稿海鏁诲濠氭晲婢跺﹤宓嗛梺缁樺姈缁佹挳宕戦幘璇叉嵍妞ゆ挻绋戞禍鐐叏濡厧浜鹃悗姘炬嫹

核心提示:使用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) {
更多精彩
赞助商链接