接口
public interface IDao<E> { public List<E> findAll(); public E findById(Integer id); public void deleteById(Integer id); public void update(E entity); public List<E> pageList(Integer start,Integer end); }
实现类
public class EmployeeDao implements IDao<Employee> { public Connection conn = JdbcUtils.getConn(); @Override public List<Employee> findAll() {...} @Override public Employee findById(Integer id) {...} @Override public void deleteById(Integer id) {...} @Override public void update(Employee entity) {...} @Override public List<Employee> pageList(Integer start, Integer end) {...} }