rightdao.java~9~
来自「《struts应用开发完全手册》中的源代码及安装指导」· JAVA~9~ 代码 · 共 46 行
JAVA~9~
46 行
package com.dao;
import com.actionForm.RightForm;
import java.util.*;
import java.sql.*;
public class RightDao {
private JDBConnection connection = null;
public RightDao() {
connection = new JDBConnection();
}
//===============================================================================
public void insertRight(String managerAccount) {
String sql = "insert into tb_managerRight values ('" +
managerAccount + "','0','0','0','0','0','0')";
connection.executeUpdate(sql);
connection.closeConnection();
}
//================================================================================
public List selectRight() {
List list = new ArrayList();
RightForm form = null;
String sql = "select * from tb_managerRight order by id";
ResultSet rs = connection.executeQuery(sql);
try {
while (rs.next()) {
form = new RightForm();
form.setId(Integer.valueOf(rs.getString(1)));
form.setManagerAccount(rs.getString(2));
form.setJcxx(Integer.valueOf(rs.getString(3)));
form.setJczl(Integer.valueOf(rs.getString(4)));
form.setYwgl(Integer.valueOf(rs.getString(5)));
form.setXxcx(Integer.valueOf(rs.getString(6)));
form.setFzgj(Integer.valueOf(rs.getString(7)));
form.setXtsz(Integer.valueOf(rs.getString(8)));
list.add(form);
}
} catch (SQLException ex) {
}
connection.closeConnection();
return list;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?