studentdaoi.java

来自「Struts+Spring+Hibernate 增删改查」· Java 代码 · 共 44 行

JAVA
44
字号
package com.yumeng.ssidemo.dao;

import java.sql.SQLException;
import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.yumeng.ssidemo.po.Student;

public class StudentDAOI extends SqlMapClientDaoSupport implements StudentDAO {

	public void deleteStudent(int id) throws SQLException {
		
        getSqlMapClientTemplate().delete("deleteStudent", id);
	}

	public void insertStudent(Student student) throws SQLException {
		getSqlMapClientTemplate().insert("insertStudent",student);
		

	}

	public void updateStudent(Student student) throws SQLException {
		getSqlMapClientTemplate().update("updateStudent", student);

	}

	public List selectAllStudent() throws SQLException {
	
		return getSqlMapClientTemplate().queryForList("selectStudent");
	}

	public Student selectStudentById(int id) throws SQLException {
		
		return (Student)getSqlMapClientTemplate().queryForObject("selectStudentById", id);
	}

	public Student selectStudentByName(String name) throws SQLException {
		
		return (Student)getSqlMapClientTemplate().queryForObject("selectStudentByName", name);
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?