emplistdao.java

来自「员工管理系统」· Java 代码 · 共 31 行

JAVA
31
字号
package com.yiboit.hhs.daos;

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

import javax.sql.DataSource;

import com.yiboit.hhs.EmpBean;
import com.yiboit.hhs.db.BaseDAO;

public class EmpListDAO extends BaseDAO {
	private static final String QUERY = 
		"select emp_id as empId, emp_name as empName, emp_sex as empSex" +
			", e.dept_id as deptId, d.dept_name as deptName, salary " +
			" from emp e, dept d where e.dept_id = d.dept_id";
	
	private List empList = null;

	public EmpListDAO(DataSource ds) throws SQLException {
		super(ds);
	}

	public void databaseAccess() throws SQLException {
		this.empList = super.sqlUtil.selectMulti(QUERY, null, EmpBean.class);
	}
	
	public List getEmpList() {
		return empList;
	}
}

⌨️ 快捷键说明

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