资源简介

JSP学生成绩管理系统源代码附带数据库 JSP+Servlet+JavaBean

资源截图

代码片段和文件信息

package com.dao;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.domain.Badmin;
import com.domain.Bclass;

import com.tools.JDBConnection;

public class Badmindao {
private JDBConnection connection = null;

// 利用构造方法调用类中的对象对数据库创建连接
public Badmindao()

{
connection = new JDBConnection();
this.connection.creatConnection();

}

public String checkadmin(String adminid) {
String password = ““;
String sql = “select * from badmin where adminid=‘“ + adminid + “‘“;
ResultSet rs = connection.executeQuery(sql);
try {
while (rs.next()) {
password = rs.getString(“password“);
}
} catch (SQLException ex) {
}
connection.closeConnection();
return password;
}

public void adminInsert(Badmin admin) {
String sql = “insert into badmin values (‘“ + admin.getAdminid()
+ “‘‘“ + admin.getPassword() + “‘)“;
connection.executeUpdate(sql);
connection.closeConnection();

}

public Badmin BadminSelect(String adminid) {

Badmin admin = null;
String sql = “select * from badmin  where adminid=‘“ + adminid + “‘“;
ResultSet rs = connection.executeQuery(sql);
try {
while (rs.next()) {
admin = new Badmin();
admin.setAdminid(rs.getString(1));
admin.setPassword(rs.getString(2));

}
} catch (SQLException ex) {
System.out.println(ex.getMessage());
}
connection.closeConnection();
return admin;
}

public boolean upPwd(Badmin admin) {
boolean flag = false;
String sql = “update badmin set password=‘“ + admin.getPassword()
+ “‘ where adminid=‘“ + admin.getAdminid() + “‘“;
flag = connection.executeUpdate(sql);
connection.closeConnection();
return flag;
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2002-01-01 00:19  studentscore\
     文件         857  2011-05-14 22:44  studentscore\.classpath
     目录           0  2002-01-01 00:19  studentscore\.myeclipse\
     文件         309  2011-06-07 21:51  studentscore\.mymetadata
     文件        1418  2011-05-22 13:31  studentscore\.project
     目录           0  2002-01-01 00:19  studentscore\.settings\
     文件         500  2011-05-22 13:31  studentscore\.settings\.jsdtscope
     文件         685  2010-07-11 23:30  studentscore\.settings\org.eclipse.core.resources.prefs
     文件          49  2011-05-22 13:31  studentscore\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2011-05-22 13:31  studentscore\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2002-01-01 00:19  studentscore\src\
     目录           0  2002-01-01 00:19  studentscore\src\com\
     目录           0  2002-01-01 00:19  studentscore\src\com\dao\
     文件        1777  2010-07-11 22:02  studentscore\src\com\dao\Badmindao.java
     文件        4997  2010-07-11 22:02  studentscore\src\com\dao\Bclassdao.java
     文件        3864  2010-07-13 21:25  studentscore\src\com\dao\Bcoursedao.java
     文件        3421  2010-07-11 22:02  studentscore\src\com\dao\Bdeptdao.java
     文件        3998  2010-07-11 22:02  studentscore\src\com\dao\Bmajordao.java
     文件        4152  2010-07-14 08:49  studentscore\src\com\dao\Bscoredao.java
     文件        5319  2010-07-13 20:12  studentscore\src\com\dao\Bstudentdao.java
     文件        4668  2010-07-11 22:02  studentscore\src\com\dao\Bteacherdao.java
     文件        4733  2010-07-14 08:32  studentscore\src\com\dao\Btlessiondao.java
     目录           0  2002-01-01 00:19  studentscore\src\com\domain\
     文件         408  2010-07-11 22:02  studentscore\src\com\domain\Badmin.java
     文件         976  2010-07-11 22:02  studentscore\src\com\domain\Bclass.java
     文件         690  2010-07-13 20:02  studentscore\src\com\domain\Bcourse.java
     文件         488  2010-07-11 22:02  studentscore\src\com\domain\Bdept.java
     文件         508  2010-07-11 22:02  studentscore\src\com\domain\Bmajor.java
     文件         803  2010-07-12 23:03  studentscore\src\com\domain\Bscore.java
     文件         955  2010-07-11 22:02  studentscore\src\com\domain\Bstudent.java
     文件         638  2010-07-11 22:02  studentscore\src\com\domain\Btecher.java
............此处省略190个文件信息

评论

共有 条评论