数据库表名student,daoimpl类实现增删改查。
public class StudentDaoImpl extends BaseDao implements StudentDao {
/**
* 查询全部学生信息
*/
@Override
public List<Student> selectAll() {
List<Student> list = new ArrayList<>();
// 获取basedao里面通用的返回结果集
String sql = "select * from student";
Object[] params = {};
ResultSet resultSet = commonExecuteQuery(sql, params);
// 将rs结果转换成list集合
try {
while (resultSet.next()) {
Student student = new Student();
student.setStudentNo(resultSet.getInt("studentNo"));
student.setLoginPsd(resultSet.getString("loginPwd"));
student.setStudentName(resultSet.getString("studentName"));
student.setSex(resultSet.getString("sex"));
student.setGradeId(resultSet.getInt("gradeId"));
student.setPhone(resultSet.getString("phone"));
student.setAddress(resultSet.getString("address"));
student.se