资源简介
教务管理系统,实现了MD5加密,验证码后台取得并进行验证,支持上传学生头像,实现了学生管理,班级管理,科目管理,成绩管理。代码纯手打,数据库文件也在。
代码片段和文件信息
package dao;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import entity.BanJi;
import entity.BanJi;
public class BanJiDao extends baseDao{
public List searchAll(){
List list=new ArrayList();
try {
getStatement();
ResultSet rs=stat.executeQuery(“select * from banji“);
while(rs.next()){
BanJi bj=new BanJi();
bj.setId(rs.getInt(“id“));
bj.setName(rs.getString(“name“));
bj.setStuNums(rs.getInt(“stuNums“));
list.add(bj);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
closeAll();
}
return list;
}
public int searchCount() {
int count = 0;
try {
getStatement();
Statement stat = conn.createStatement();
String sql = “select count(id) from banji“;
rs = stat.executeQuery(sql);
if (rs.next()) {
count = rs.getInt(1);
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
closeAll();
}
return count;
}
public List searchByBegin(int begin int num) {
List list = new ArrayList();
try {
getStatement();
Statement stat = conn.createStatement();
String sql = “select * from banji limit “ + begin + ““ + num;
rs = stat.executeQuery(sql);
while (rs.next()) {
BanJi bj = new BanJi();
bj.setId(rs.getInt(“id“));
bj.setName(rs.getString(“name“));
bj.setStuNums(rs.getInt(“stuNums“));
list.add(bj);
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
closeAll();
}
return list;
}
public boolean add(BanJi bj) {
boolean flag = false;
try {
String sql = “insert into banji (name) “
+ “ values(?)“;
getPreparedStatement(sql);
pstat.setString(1 bj.getName());
int rs = pstat.executeUpdate();
if (rs > 0) {
flag = true;
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
closeAll();
}
return flag;
}
public BanJi searchById(int id) {
BanJi bj = null;
try {
getStatement();
Statement stat = conn.createStatement();
String sql = “select * from banji where id= “
+ id;
rs = stat.executeQuery(sql);
if (rs.next()) {
bj = new BanJi();
bj.setId(rs.getInt(“id“));
bj.setName(rs.getString(“name“));
bj.setStuNums(rs.getInt(“stuNums“));
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
closeAll();
}
return bj;
}
public boolean motify(BanJi bj) {
boolean flag = false;
try {
String sql = “update banji set name=?where id=? “;
getPreparedStatement(sql);
pstat.setString(1 bj.getName());
pstat.setInt(2 bj.getId());
int rs = pstat.executeUpdate()
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-12-04 13:25 stuWeb\
文件 1093 2017-09-11 16:36 stuWeb\.classpath
文件 1332 2017-09-19 15:20 stuWeb\.project
目录 0 2017-12-04 13:17 stuWeb\.settings\
文件 522 2017-09-11 16:36 stuWeb\.settings\.jsdtscope
文件 93 2017-09-11 16:42 stuWeb\.settings\com.genuitec.eclipse.core.prefs
文件 1009 2017-09-19 16:33 stuWeb\.settings\com.genuitec.eclipse.j2eedt.core.prefs
文件 364 2017-09-11 16:36 stuWeb\.settings\org.eclipse.jdt.core.prefs
文件 479 2017-09-19 16:33 stuWeb\.settings\org.eclipse.wst.common.component
文件 414 2017-09-11 16:36 stuWeb\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2017-09-11 16:36 stuWeb\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2017-09-11 16:36 stuWeb\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 18163 2017-12-04 13:19 stuWeb\school.sql
目录 0 2017-12-04 13:17 stuWeb\src\
目录 0 2017-12-04 13:17 stuWeb\src\dao\
文件 5188 2017-09-14 16:49 stuWeb\src\dao\BanJiDao.java
文件 1566 2017-09-19 20:32 stuWeb\src\dao\ba
文件 4130 2017-09-21 20:23 stuWeb\src\dao\ScoreDao.java
文件 7346 2017-09-22 19:19 stuWeb\src\dao\StudentDao.java
文件 3586 2017-09-20 10:56 stuWeb\src\dao\Subject2BanjiDao.java
文件 4838 2017-09-21 19:29 stuWeb\src\dao\SubjectDao.java
文件 2778 2017-09-26 15:05 stuWeb\src\dao\UserDao.java
目录 0 2017-12-04 13:17 stuWeb\src\entity\
文件 677 2017-09-19 20:48 stuWeb\src\entity\BanJi.java
文件 713 2017-09-21 20:22 stuWeb\src\entity\Score.java
文件 812 2017-09-22 16:24 stuWeb\src\entity\Student.java
文件 297 2017-09-14 20:07 stuWeb\src\entity\Subject.java
文件 621 2017-09-26 14:16 stuWeb\src\entity\User.java
文件 393 2017-09-25 19:17 stuWeb\src\entity\ValidateCode.java
目录 0 2017-12-04 13:17 stuWeb\src\filter\
文件 1070 2017-09-20 11:32 stuWeb\src\filter\CharacterFilter.java
............此处省略127个文件信息
评论
共有 条评论