使用JDBCTemplate实现与Spring结合,方法公用 ——Emp实现类(EmpDaoImpl)
来源:互联网 发布:mac迅雷界面看不见人物 编辑:程序博客网 时间:2024/06/05 04:33
/** * @Title: EmpDaoImpl.java* @Package org.dao.impl* @Description: TODO该方法的主要作用:* @author A18ccms A18ccms_gmail_com * @date 2017-6-3 下午2:42:51* @version V1.0 */package org.dao.impl;import java.io.Serializable;import java.util.List;import org.dao.BaseDao;import org.entity.Emp;import org.springframework.orm.hibernate3.support.HibernateDaoSupport; /** * * 项目名称:BaseTestMain * 类名称:EmpDaoImpl * 类描述: * 创建人:Mu Xiongxiong * 创建时间:2017-6-3 下午2:42:51 * 修改人:Mu Xiongxiong * 修改时间:2017-6-3 下午2:42:51 * 修改备注: * @version * */public class EmpDaoImpl extends BaseImpl<Emp> implements BaseDao<Emp> {@Overridepublic void update(Emp entity ,int tag) {String sql = "";Object objects[] = null;if(tag==1){//添加sql="insert into emp (empno,ename) values(?,?)";objects = new Object[] {entity.getEmpno(),entity.getEname()};}else if(tag==2){//修改sql="update emp set ename=? where empno = ?";objects = new Object[] {entity.getEname(),entity.getEmpno()};}else if(tag==3){//删除sql="delete from emp where empno = ?";objects = new Object[] {entity.getEmpno()};}super.update(sql, objects);}@Overridepublic List<Emp> getLists() {String sql = "select * from emp";return super.getAll(sql);}@Overridepublic Emp getInfoById(Serializable id) {String sql="select * from emp where empno = ?";return super.getById(sql, id);}/** * (非 Javadoc) * <p>Title: testProcedure</p> * <p>Description(描述):调用存储过程 </p> * @param emp * @return * @see org.dao.impl.BaseImpl#testProcedure(org.entity.Emp) */ public Integer testProcedure(Emp emp){ return super.testProcedure(emp); }}
阅读全文
0 0
- 使用JDBCTemplate实现与Spring结合,方法公用 ——Emp实现类(EmpDaoImpl)
- 使用JDBCTemplate实现与Spring结合,方法公用 ——共用实现类(BaseImpl)
- 使用JDBCTemplate实现与Spring结合,方法公用 ——Spring配置(applicationContext.xml)
- 使用JDBCTemplate实现与Spring结合,方法公用 ——接口(BaseDao)
- 使用JDBCTemplate实现与Spring结合,方法公用 ——测试(EmpDaoImplTest)
- 使用JDBCTemplate实现与Spring结合,方法公用
- Spring 使用JdbcTemplate类实现批量查询(RowMapper)
- Spring 使用JdbcTemPlate的方式实现与数据库的连接
- 使用Spring的JdbcTemplate实现DAO(续)
- 使用Spring的JdbcTemplate实现分页功能
- 使用Spring的JdbcTemplate实现DAO
- 使用Spring JdbcTemplate实现SQL批处理
- Spring使用JdbcTemplate实现对数据库操作
- Spring使用JdbcTemplate实现对数据库操作
- Spring使用JdbcTemplate实现对数据库操作
- Spring使用JdbcTemplate实现对数据库操作
- Spring使用JdbcTemplate实现对数据库操作
- Spring使用JdbcTemplate实现对数据库操作
- linux设置服务为自动启动和关闭并禁用的命令
- Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds
- NIO selector原理浅析
- Edit Distance(dp)
- 【整理】负载测试、压力测试、性能测试的区别
- 使用JDBCTemplate实现与Spring结合,方法公用 ——Emp实现类(EmpDaoImpl)
- android入门(五大布局)
- python2.7中文编码
- 修改树状控件TreeCtrl的节点名称
- 第六次上机作业Define a concrete class intset&&EOJ2853
- 20170315 c++上机作业—两个类的交互
- 查看APK的签名信息
- php5.4升级到php7
- base64