资源简介
基于j2ee的学生信息管理系统数据库是MySQL5.7,框架是MVC,使用到了Dao,javabean,servlet、jsp

代码片段和文件信息
package Dao;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Collection;
import VO.MySQLData;
import VO.Student;
import VO.StudentInfo;
public class LoginSelect {
private Connection conn=null;
private PreparedStatement pstmt=null;
private MySQLData Database;
public LoginSelect() throws Exception
{
Database = new MySQLData();
conn=Database.getConnection();
}
public LoginSelect(Connection conn) {
super();
this.conn = conn;
}
public String SelectStudent(int midString password) throws Exception{//登录查询
String flag=““;
String sql=“select Name from student where Id=? and password=?“;
this.pstmt=this.conn.prepareStatement(sql);
this.pstmt.setInt(1mid);
this.pstmt.setString(2 password);
ResultSet rs=this.pstmt.executeQuery();
while(rs.next())
{
flag=rs.getString(1);
break;
}
return flag;
}
public String SelectMember(int midString password) throws Exception{//登录查询
String flag=““;
String sql=“select name from member where mid=? and password=?“;
this.pstmt=this.conn.prepareStatement(sql);
this.pstmt.setInt(1mid);
this.pstmt.setString(2 password);
ResultSet rs=this.pstmt.executeQuery();
while(rs.next())
{
flag=rs.getString(1);
break;
}
return flag;
}
public Collection SelectStudent() throws SQLException {
Student student = null;
Collection studentCollect = new ArrayList();
String sql = “select * from student“;
this.pstmt=this.conn.prepareStatement(sql);
ResultSet rs = this.pstmt.executeQuery(); //执行SQL语句
try { //捕捉异常信息
while (rs.next()) {
student = new Student();
student.setId(rs.getInt(1));
student.setName(rs.getString(2));
student.setSex(rs.getString(3));
student.setMajor(rs.getString(4));
studentCollect.add(student); //将查询结果保存到Collection集合中
}
} catch (SQLException e) {}
return studentCollect; //返回查询结果
}
public Student SelectStudent(int Id) throws SQLException {
Student student = null;
String sql = “select * from student where Id = “+Id;
this.pstmt=this.conn.prepareStatement(sql);
ResultSet rs = this.pstmt.executeQuery();
try { //捕捉异常信息
while (rs.next()) {
student = new Student();
student.setId(rs.getInt(1));
student.setName(rs.getString(2));
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2020-06-19 15:01 1299_牛月华_1541_张万_学生管理系统\
目录 0 2020-06-19 09:38 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\
文件 841 2020-06-11 21:19 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\.classpath
文件 911 2020-06-11 21:19 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\.project
目录 0 2020-06-19 09:38 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\.settings\
文件 567 2020-06-11 21:19 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\.settings\.jsdtscope
文件 108 2020-06-16 14:58 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\.settings\org.eclipse.core.resources.prefs
文件 364 2020-06-11 21:19 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\.settings\org.eclipse.jdt.core.prefs
文件 485 2020-06-11 21:19 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\.settings\org.eclipse.wst.common.component
文件 345 2020-06-11 21:19 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2020-06-11 21:19 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2020-06-11 21:19 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2020-06-19 09:38 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\build\
目录 0 2020-06-19 09:38 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\build\classes\
目录 0 2020-06-19 09:38 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\build\classes\Dao\
文件 5100 2020-06-18 16:18 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\build\classes\Dao\LoginSelect.class
目录 0 2020-06-19 09:38 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\build\classes\servlet\
文件 5241 2020-06-16 23:09 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\build\classes\servlet\LoginSevelet.class
目录 0 2020-06-19 09:38 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\build\classes\VO\
文件 1271 2020-06-14 17:39 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\build\classes\VO\MySQLData.class
文件 1085 2020-06-14 21:49 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\build\classes\VO\Student.class
文件 1724 2020-06-18 15:52 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\build\classes\VO\StudentInfo.class
目录 0 2020-06-19 09:38 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\src\
目录 0 2020-06-19 09:38 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\src\Dao\
文件 5949 2020-06-18 16:18 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\src\Dao\LoginSelect.java
目录 0 2020-06-19 09:38 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\src\servlet\
文件 5920 2020-06-16 23:09 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\src\servlet\LoginSevelet.java
目录 0 2020-06-19 09:38 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\src\VO\
文件 1031 2020-06-14 17:39 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\src\VO\MySQLData.java
文件 534 2020-06-14 21:49 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\src\VO\Student.java
文件 1009 2020-06-18 15:52 1299_牛月华_1541_张万_学生管理系统\1299_牛月华_1541_张万\src\VO\StudentInfo.java
............此处省略537个文件信息
相关资源
- JSP学生信息管理系统 Mysql数据库
- jsp 学生信息管理系统设计与实现
- 学生信息管理系统 JSP MySQL
- 学生信息管理系统 JAVA课程设计
- jsp mysql tomcat学生信息管理系统
- 东南大学 JAVA课程设计 学生信息管理
- jsp+mysql学生信息管理系统
- 学生信息管理系统源码+mysql数据库
- java编写的学生信息管理系统 没有数据
- 学生信息管理系统 java+access
- Java学生信息管理系统(有界面、有数
- 学生信息管理系统源码+数据库.zip
- 学生信息管理系统课程设计
- 基于java的学生信息管理系统282480
- jsp、servlet实现学生信息管理系统
- Java学生信息管理系统源码含数据库脚
- jsp+sql+mysql学生信息管理系统源代码
- SQLite Demo——学生信息管理系统andro
- Oracle Java Swing 学生信息管理系统
- JAVAEE_学生信息管理系统
- 学生信息管理系统源码(JAVA 毕业设计
- 学生信息管理系统(MySQL版)V1.0.rar
- 基于mvc的jsp开发教材学生信息管理系
- 2016秋广工数据库课程设计学生信息管
- 学生信息管理系统源码+数据库+构架文
- 学生信息管理系统 Java+sql server
- tomcat基于Web的JSP+Servlet学生信息管理系
- Java+Swing学生信息管理系统
- 学生信息管理系统oracle jsp
- JAVA学生信息管理系统大作业非成绩
评论
共有 条评论