资源简介
学生成绩管理系统 课设级 主要运用struts2框架+mysql
基于struts2的学生成绩管理系统页面
1.安装eclipse Jee、Tomcat9.0、jdk1.8版本以上、mysql5.5以上
2.导入文件和数据库
介绍连接:https://blog.csdn.net/weixin_41343021/article/details/105679335
代码片段和文件信息
package action;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Map;
import db.db;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class admin extends ActionSupport {
private static final long serialVersionUID = 1L;
public String username;
public String password;
public int role;
public String action;
public ArrayList stuParamArray;
@Override
public String execute() throws Exception {
Connection conn=db.createDBConn();
//----查询数据操作----
String sqlwhere=new String(““);
String sql=new String(““);
if(“select“.equals(action)){//如果是查询操作
if(username!=null&&username.trim().length()!=0)
sqlwhere=“where username like ‘%“+username.trim()+“%‘ “;
sql=“select * from admin “+sqlwhere;
Statement state=conn.createStatement();
ResultSet rs=state.executeQuery(sql);
ArrayList stuArray=new ArrayList();
while(rs.next()){
admin stu=new admin();
stu.setUsername(rs.getString(“username“));
stu.setPassword(rs.getString(“password“));
stu.setRole(rs.getInt(“role“));
stuArray.add(stu);
}
Map request = (Map)ActionContext.getContext().get(“request“);
request.put(“stuArray“ stuArray);
}
if(stuParamArray!=null&&“update“.equals(action)){
for(int i=0;i String sqlstr=“update admin set role=“+stuParamArray.get(i).getRole()+
“ where username=‘“+stuParamArray.get(i).getUsername()+“‘“;
Statement state=conn.createStatement();
state.executeUpdate(sqlstr);
}
}
db.closeConn(conn);
return SUCCESS;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public int getRole() {
return role;
}
public void setRole(int role) {
this.role = role;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public ArrayList getStuParamArray() {
return stuParamArray;
}
public void setStuParamArray(ArrayList stuParamArray) {
this.stuParamArray = stuParamArray;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2020-03-30 08:59 student-master\
文件 278 2020-03-30 08:59 student-master\.gitignore
文件 266 2020-03-30 08:59 student-master\README.md
文件 6617 2020-03-30 08:59 student-master\student.sql
目录 0 2020-03-30 08:59 student-master\student\
目录 0 2020-03-30 08:59 student-master\student\WebContent\
目录 0 2020-03-30 08:59 student-master\student\WebContent\me
文件 39 2020-03-30 08:59 student-master\student\WebContent\me
目录 0 2020-03-30 08:59 student-master\student\WebContent\WEB-INF\
目录 0 2020-03-30 08:59 student-master\student\WebContent\WEB-INF\lib\
文件 69002 2020-03-30 08:59 student-master\student\WebContent\WEB-INF\lib\commons-fileupload-1.3.1.jar
文件 173587 2020-03-30 08:59 student-master\student\WebContent\WEB-INF\lib\commons-io-2.2.jar
文件 315805 2020-03-30 08:59 student-master\student\WebContent\WEB-INF\lib\commons-lang3-3.1.jar
文件 62050 2020-03-30 08:59 student-master\student\WebContent\WEB-INF\lib\commons-logging-1.1.3.jar
文件 931168 2020-03-30 08:59 student-master\student\WebContent\WEB-INF\lib\freemarker-2.3.19.jar
文件 614203 2020-03-30 08:59 student-master\student\WebContent\WEB-INF\lib\javassist-3.11.0.GA.jar
文件 489884 2020-03-30 08:59 student-master\student\WebContent\WEB-INF\lib\log4j-1.2.17.jar
文件 999635 2020-03-30 08:59 student-master\student\WebContent\WEB-INF\lib\mysql-connector-java-5.1.44-bin.jar
文件 227997 2020-03-30 08:59 student-master\student\WebContent\WEB-INF\lib\ognl-3.0.6.jar
文件 799980 2020-03-30 08:59 student-master\student\WebContent\WEB-INF\lib\struts2-core-2.3.16.1.jar
文件 653278 2020-03-30 08:59 student-master\student\WebContent\WEB-INF\lib\xwork-core-2.3.16.1.jar
文件 978 2020-03-30 08:59 student-master\student\WebContent\WEB-INF\web.xm
文件 2755 2020-03-30 08:59 student-master\student\WebContent\banner.html
文件 3000 2020-03-30 08:59 student-master\student\WebContent\course.jsp
目录 0 2020-03-30 08:59 student-master\student\WebContent\css\
文件 6423 2020-03-30 08:59 student-master\student\WebContent\css\common_st
文件 66957 2020-03-30 08:59 student-master\student\WebContent\css\easyui.css
文件 3480 2020-03-30 08:59 student-master\student\WebContent\css\icon.css
文件 4097 2020-03-30 08:59 student-master\student\WebContent\css\st
文件 2960 2020-03-30 08:59 student-master\student\WebContent\department.jsp
文件 3080 2020-03-30 08:59 student-master\student\WebContent\grade.jsp
............此处省略88个文件信息
- 上一篇:SSM整合-商贸系统
- 下一篇:实验89答案.doc
评论
共有 条评论