本系统由北风网特邀上海讲师陶宝哥主讲的HR(人力资源管理系统中的子模块)权限管理预热模块,
本课程分为上、下两个,附带代码
这是一个完整的设计案例,因为很多学生反应这个不会,我们特别把该部分免费给学员学习!



课程中代码齐全,是一个完整的项目
private RightDAO(){
}
private static RightDAO rightDAO;
public static RightDAO getInstance(){
if(rightDAO == null)
rightDAO = new RightDAO();
return rightDAO;
}
public void insertRight(Rights right) throws SQLException{
Connection conn = this.getConnection();
String sql = "insert into rights values(0,?)";
PreparedStatement ps = conn.prepareStatement(sql);
ps.setString(1, right.getRightName());
int i = ps.executeUpdate();
if(i<=0)
throw new SQLException("插入数据出现了错误");
}
public Rights getRightsById(final int id) throws SQLException{
return getRights(new RightGetter(){
public String addCondition() {
return "rightId = ?";
}
public void setValue(PreparedStatement ps) throws SQLException {
ps.setInt(1, id);
}
});
}