package cn.com.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import cn.com.entity.Score;
import cn.com.entity.Student;
import cn.com.utils.DBUtils;
public class StuDao {
Connection conn;
PreparedStatement pst;
ResultSet rs;
public Student stulogin(Student stu) {
// TODO Auto-generated method stub
try {
conn = DBUtils.getConn();
String sql = "select * from student where sid = ? and sname = ? and spwd = ?";
pst = conn.prepareStatement(sql);
pst.setString(1, stu.getSid());
pst.setString(2, stu.getSname());
pst.setString(3, stu.getSpwd());
rs = pst.executeQuery();
while(rs.next()){
Student st = new Student();
st.setSid(rs.getString("sid"));
st.setSname(rs.getString("sname"));
st.setSeid(rs.getString("seid"));
st.setSpwd(rs.getString("spwd"));
st.setSsex(rs.getInt("ssex"));
st.setSof(rs.getString("sof"));
st.setScountenance(rs.getString("sid"));
st.setSchooling(rs.getString("schooling"));
st.setStatus(rs.getInt("status"));
st.setSxuezhi(rs.getString("sxuezhi"));
st.setPhone(rs.getString("phone"));
st.setMid(rs.getInt("mid"));
st.setCid(rs.getInt("cid"));
return st;
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
DBUtils.closeResouce(conn, pst, rs);
}
return null;
}
public List<Student> stuByshow(String sid) {
// TODO Auto-generated method stub
try {
conn = DBUtils.getConn();
String sql = "select * from student s,major m,class c where s.mid = m.mid and s.cid = c.cid and s.sid = ?";
pst = conn.prepareStatement(sql);
pst.setString(1, sid);
rs = pst.executeQuery();
List<Student> bylist = new ArrayList();
while(rs.next()){
Student st = new Student();
st.setSid(rs.getString("sid"));
st.setSname(rs.getString("sname"));
st.setSeid(rs.getString("seid"));
st.setSpwd(rs.getString("spwd"));
st.setSsex(rs.getInt("ssex"));
st.setSof(rs.getString("sof"));
st.setScountenance(rs.getString("scountenance"));
st.setSchooling(rs.getString("schooling"));
st.setStatus(rs.getInt("status"));
st.setSxuezhi(rs.getString("sxuezhi"));
st.setPhone(rs.getString("phone"));
st.setSphone(rs.getString("sphone"));
st.setSqq(rs.getString("sqq"));
st.setSmail(rs.getString("smail"));
st.setMid(rs.getInt("mid"));
st.setCid(rs.getInt("cid"));
st.setMname(rs.getString("mname"));
st.setCname(rs.getString("cname"));
bylist.add(st);
System.out.println(bylist+"???");
}
return bylist;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
DBUtils.closeResouce(conn, pst, rs);
}
return null;
}
public Student stu2(String sid) {
// TODO Auto-generated method stub
try {
conn = DBUtils.getConn();
String sql = "select * from student where sid = ?";
pst = conn.prepareStatement(sql);
pst.setString(1, sid);
rs = pst.executeQuery();
while(rs.next()){
Student st = new Student();
st.setSid(rs.getString("sid"));
st.setSname(rs.getString("sname"));
st.setSeid(rs.getString("seid"));
st.setSpwd(rs.getString("spwd"));
st.setSsex(rs.getInt("ssex"));
st.setSof(rs.getString("sof"));
st.setScountenance(rs.getString("sid"));
st.setSchooling(rs.getString("schooling"));
st.setStatus(rs.getInt("status"));
st.setSxuezhi(rs.getString("sxuezhi"));
st.setPhone(rs.getString("phone"));
st.setMid(rs.getInt("mid"));
st.setCid(rs.getInt("cid"));
st.setSmail(rs.getString("smail"));
return st;
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
DBUtils.closeResouce(conn, pst, rs);
}
return null;
}
public List<Student> spwd(String sid) {
// TODO Auto-generated method stub
try {
conn = DBUtils.getConn();
String sql = "select spwd from student where sid = ?";
pst = conn.prepareStatement(sql);
pst.setString(1, sid);
List<Student> slist = new ArrayList<>();
rs = pst.executeQuery();
while(rs.next()){
Student st = new Student();
st.setSpwd(rs.getString("spwd"));
slist.add(st);
System.out.println(slist+"!@@@");
}
return slist;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
DBUtils.closeResouce(conn, pst, rs);
}
return null;
}
public List<Score> stuScoreByshow(String sid) {
// TODO Auto-generated method stub
try {
conn = DBUtils.getConn();
String sql = "select * from student st,score s,teacher t where st.sid = s.sid and s.tid = t.tid and st.sid = ?";
pst = conn.prepareStatement(sql);
pst.setString(1, sid);
rs = pst.executeQuery();
List<Score> bylist = new ArrayList();
while(rs.next()){
Score sc = new Score();
sc.setScid(rs.getInt("scid"));
sc.setSyear(rs.getString("syear"));
sc.setStem(rs.getString("stem"));
sc.setScname(rs.getString("scname"));
sc.setStype(rs.getInt("stype"));
sc.setSkhfs(rs.getInt("skhfs"));
sc.setScore(rs.getInt("score"));
sc.setSxf(rs.getInt("sxf"));
sc.setSid(rs.getString("sid"));
sc.setTid(rs.getString("tid"));
sc.setTname(rs.getString("tname"));
bylist.add(sc);
System.out.println(bylist+"???");
}
return bylist;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
DBUtils.closeResouce(conn, pst, rs);
}
return null;
}
public void updateInfo(Student stu) {
// TODO Auto-generated method stub
try {
conn = DBUtils.getConn();
String sql = "update student set phone = ?,sphone = ?,sqq = ?,smail = ? where sid = ?";
pst = conn.prepareStatement(sql);
pst.setString(1, stu.getPhone());
pst.setString(2, stu.getSphone());
pst.setString(3, stu.getSqq());
pst.setString(4, stu.getSmail());
pst.setString(5, stu.getSid());
pst.executeUpdate();
System.out.println("!!!!!!!!!!");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
DBUtils.closeResouce(conn, pst);
}
}
public void updateSpwd(Student stu) {
// TODO Auto-generated method stub
try {
conn = DBUtils.getConn();
String sql = "update student set spwd = ? where sid = ?";
pst = conn.prepareStatement(sql);
pst.setString(1, stu.getSpwd());
pst.setString(2, stu.getSid());
pst.executeUpdate();
System.out.println("!!!!!!!!!!");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
DBUtils.closeResouce(conn, pst);
}
}
public void checkDel(Student student) {
// TODO Auto-generated method stub
try {
conn = DBUtils.getConn();
String sql = "delete from student where sid = ?";
pst = conn.prepareStatement(sql);
pst.setString(1, student.getSid());
pst.executeUpdate();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
DBUtils.closeResouce(conn, pst);
}
}
public List<Student> studentByid(Student student) {
// TODO Auto-generated method stub
List<Student> list = new ArrayList<Student>();
try {
conn = DBUtils.getConn();
String sql = "select * from student where sid = ?";
pst = conn.prepareStatement(sql);
pst.setString(1, student.getSid());
rs = pst.executeQuery();
while(rs.next()){
Student st = new Student();
st.setSid(rs.getString("sid"));
st.setSname(rs.getString("sname"));
st.setSeid(rs.getString("seid"));
st.set
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
《计算机毕业设计:Java实现的学校官网教务图书馆管理系统》是一套功能齐全、设计精良的计算机毕业设计资源,特别适合用于本科课程设计、毕业设计以及Java学习者的实践项目。这套资源不仅包含了完整的源码和详尽的说明文档,还附赠了专业的计算机答辩PPT模板,为用户的项目实现和答辩展示提供了全方位的支持。 在源码方面,该系统采用Java编程语言进行开发,确保了系统的稳定性和高效性。源码设计合理,逻辑清晰,实现了教务管理、图书馆管理、官网信息发布等多项功能,满足了学校日常管理的需求。通过研读源码,用户可以深入了解Java Web开发的核心技术,包括数据库操作、用户认证、信息展示等关键环节,为日后的学习和工作打下坚实的基础。 说明文档则对系统的整体架构、功能模块、实现细节以及关键代码进行了详细的解释和说明。用户可以通过阅读说明文档,快速掌握系统的开发流程和实现原理,为后续的学习和实践提供有力的指导。此外,说明文档还提供了丰富的技术资料和参考资源,帮助用户进一步拓展知识和技能。 附赠的计算机答辩PPT模板则为用户提供了一个展示毕业设计成果的专业平台。模板设计精美,内容丰富。
资源推荐
资源详情
资源评论
收起资源包目录
计算机毕业设计:Java实现的学校官网教务图书馆管理系统(源码+说明),保证可靠运行,附赠计算机答辩PPT模板 (1562个子文件)
StuDao.class 10KB
TeaDao.class 9KB
AdminDao.class 7KB
BookDao.class 7KB
Student.class 6KB
LoginServlet.class 4KB
ItemDao.class 4KB
ClassDao.class 3KB
ShowMemDao.class 3KB
LenbookDao.class 3KB
Score.class 3KB
Books.class 3KB
ShowItemDao.class 3KB
ForgetPwd.class 3KB
Lenbook.class 3KB
AddBook.class 3KB
AddItemServlet.class 3KB
Studentupdate.class 3KB
AddStu.class 2KB
AddMemberServlet.class 2KB
forgetpwd.class 2KB
AddLenb.class 2KB
ShowMemberServlet.class 2KB
Class.class 2KB
SelectByIdMemDao.class 2KB
StudentUpdateA.class 2KB
AddAdminServlet.class 2KB
UpdateMemServlet.class 2KB
Admin.class 2KB
AddPJ.class 2KB
DeleteItemServlet.class 2KB
StuLogin.class 2KB
TeaLogin.class 2KB
ShowQuestion.class 2KB
yanzheng.class 2KB
ShowStuAll.class 2KB
ShowItemServlet.class 2KB
ShowBook.class 2KB
Question.class 2KB
ShowAdmin.class 2KB
ClassByShwo.class 2KB
UpdateMemDao.class 2KB
StuByShwo.class 2KB
ShowStumohu.class 2KB
UpdateBookServlet.class 2KB
UpdateAdminServlet.class 2KB
UpdateSpwd.class 2KB
DBUtils.class 2KB
DButils.class 2KB
StuScoreByShwo.class 2KB
UpdateItemServlet.class 2KB
ShowClass.class 2KB
Member.class 2KB
DeleteAdmin.class 2KB
UpdateSinfo.class 2KB
MailUtil.class 2KB
SelectByIdItem.class 2KB
AdminService.class 2KB
StuService.class 2KB
SelectByIdBook.class 2KB
note.class 2KB
SelectByIdMem.class 2KB
ShowBookByi.class 2KB
QuDao.class 2KB
BookNote.class 2KB
SelectByIdAdmin.class 2KB
CheckDel.class 2KB
Teacher.class 2KB
MemDao.class 2KB
DeleteMemServlet.class 2KB
DeleteBook.class 2KB
Page.class 1KB
Page.class 1KB
BookServices.class 1KB
DeleteMemDao.class 1KB
ShowLenb.class 1KB
LoginoutServlet.class 1KB
Item.class 1KB
TeaService.class 1KB
EncodingFilter.class 1KB
Major.class 1KB
ItemService.class 1KB
ClassService.class 979B
ShowMemService.class 926B
LenbookService.class 877B
Stuyzm.class 839B
SelectByIdMemService.class 804B
ShowItemService.class 696B
MailUtil$1.class 680B
DeleteMemService.class 578B
UpdateMemService.class 567B
MemberService.class 566B
QuService.class 554B
.classpath 841B
org.eclipse.wst.common.component 488B
org.eclipse.wst.jsdt.ui.superType.container 49B
bootstrap.css 129KB
dandelion.css 62KB
easyui.css 59KB
easyui.css 58KB
共 1562 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16
资源评论
小新要变强
- 粉丝: 0
- 资源: 536
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 先秦文学试题库参考答案与解析.doc
- 西南大学《心理健康教育》作业和答案.doc
- 镶嵌式电力调度模拟屏通用技术条件.doc
- 小学数学综合实践活动《营养午餐》教学案例[陈倩影].doc
- 宜宾市义教小学数学学科教学指导意见(李冰).doc
- 义务教育学校校长专业标准.doc
- 一年级(下册)语文第八单元单元分析和教(学)案.doc
- 珍惜资源,保护环境作文.doc
- 园艺植物研究--紫罗兰的切花保鲜.doc
- 中小学教师招考教综知识点整理.doc
- 中考语文试题分类解析-选词填空.doc
- 中小学综合实践活动教学案.doc
- 中医推拿关节整复手法学习.doc
- 中学生心理健康教育的方法和途径.doc
- 桩基技术人员培训考试题.doc
- 注册安全工程师安全生产法及相关法律法规考前知识点总结.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功