package com.sevenEleven.javaBean.exam;
import java.util.ArrayList;
import java.util.List;
import com.sevenEleven.Beans.CchooseTestBean;
import com.sevenEleven.Beans.CtextTestBean;
import com.sevenEleven.javaBean.CDBConnection;
/**
* @author Tim
* 关于老师对试题表的操作Bean
*/
public class Cexam extends CDBConnection {
@SuppressWarnings("unchecked")
/**
* @author Tim Something about exam find the teacher who came into this
* system and his's course and make view in the page of
* teacher\exam_addTest.jsp
*/
private String id;
private String countOfChoose1;
private String countOfChoose2;
private String countOfText;
public List findLesson1(String teacherNumber) { // 由老师找必修课
if (!checkParameter(teacherNumber)) {
teacherNumber = "null";
}
try {
sql = "select distinct a.T_SKILL \"course\" from teacher a, lesson1 b where a.T_SKILL = b.L1_Name and a.T_number ="
+ " '" + teacherNumber + "' ";
if (con == null) {
DBConn(); // 连接
}
rs = executeQuery(sql);
List list = new ArrayList();
for (int i = 0; rs.next(); i++) {
// rs.getCursorName().length();
list.add(i, rs.getString("course"));
}
this.dropConnection();
return list;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/*
* @author Tim Something about exam find the teacher who came into this
* system and his's course and make view in the page of
* teacher\exam_addTest.jsp
*/
@SuppressWarnings("unchecked")
public List findLesson2(String teacherNumber) { // 由老师找选修课
if (!checkParameter(teacherNumber)) {
teacherNumber = "null";
}
try {
// Clesson1Bean lesson2 = null;
sql = "select distinct a.T_SKILL \"course\" from teacher a, lesson2 b where a.T_SKILL = b.L2_Name and a.T_number ="
+ " '" + teacherNumber + "' ";
if (con == null) {
DBConn(); // 连接
}
rs = executeQuery(sql);
List list = new ArrayList();
for (int i = 0; rs.next(); i++) {
// rs.getCursorName().length();
list.add(i, rs.getString("course"));
}
this.dropConnection();
return list;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/*
* @author tim insert infomation of one test to the Table "Choose1"
*
*/
public boolean insertIntoChoose1Table(CchooseTestBean test) {
try {
sql = "insert into choose1 values ("// + test.getCh_id() + ", "
+ test.getL_id() + ", " + " '" + test.getCh_question()
+ "' , '" + test.getKeya() + "' , '" + test.getKeyb()
+ "' , '" + test.getKeyc() + "' , '" + test.getKeyd()
+ "' , '" + test.getAnswer() + "' , " + test.getType()
+ ") ";
if (con == null) {
DBConn(); // 连接
}
if (this.executeUpdate(sql) != 0) {
executeUpdate("commit");
return true;
}
} catch (Exception e) {
e.printStackTrace();
return false;
}
return false;
}
/*
* @author tim update infomation of one test to the Table "Choose1"
*
*/
public boolean updateChoose1Table(CchooseTestBean choose) {
try {
sql = "update choose1 set CH_QUESTION= '" + choose.getCh_question()
+ "' ," + "KEYA= '" + choose.getKeya() + "' ," + "KEYB= '"
+ choose.getKeyb() + "' ," + "KEYC= '" + choose.getKeyc()
+ "' ," + "KEYD= '" + choose.getKeyd() + "' ,"
+ "CH_ANSWER= '" + choose.getAnswer() + "' "
+ " WHERE CH_ID=" + choose.getCh_id();
if (con == null) {
DBConn(); // 连接
}
if (this.executeUpdate(sql) != 0) {
executeUpdate("commit");
return true;
}
} catch (Exception e) {
e.printStackTrace();
return false;
}
return false;
}
/*
* @author tim insert infomation of one test to the Table "Choose2" by the
* attribute of courseType
*/
public boolean insertIntoChoose2Table(CchooseTestBean test) {
try {
sql = "insert into choose2 values (" //+ test.getCh_id() + ", "
+ test.getL_id() + ", " + " '" + test.getCh_question()
+ "' , '" + test.getKeya() + "' , '" + test.getKeyb()
+ "' , '" + test.getKeyc() + "' , '" + test.getKeyd()
+ "' , '" + test.getAnswer() + "' , " + test.getType()
+ ") ";
if (con == null) {
DBConn(); // 连接
}
if (this.executeUpdate(sql) != 0) {
executeUpdate("commit");
return true;
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/*
* @author tim update infomation of one test to the Table "Choose2" by the
* attribute of courseType
*/
public boolean updateChoose2Table(CchooseTestBean choose) {
try {
sql = "update choose2 set CH_QUESTION= '" + choose.getCh_question()
+ "' ," + "KEYA= '" + choose.getKeya() + "' ," + "KEYB= '"
+ choose.getKeyb() + "' ," + "KEYC= '" + choose.getKeyc()
+ "' ," + "KEYD= '" + choose.getKeyd() + "' ,"
+ "CH_ANSWER= '" + choose.getAnswer() + "' "
+ " WHERE CH_ID=" + choose.getCh_id();
if (con == null) {
DBConn(); // 连接
}
if (this.executeUpdate(sql) != 0) {
executeUpdate("commit");
return true;
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* @author tim insert infomation of one test to the Table "text1" by the
* attribute of courseType
*/
public boolean insertIntoText1Table(CtextTestBean text) {
try {
sql = "insert into text1 values ( " //+ text.getText_id() + ", "
+ text.getL_id() + ", '" + text.getText_question()
+ "' , '" + text.getText_answer() + "') ";
if (con == null) {
DBConn(); // 连接
}
if (this.executeUpdate(sql) != 0) {
executeUpdate("commit");
return true;
}
} catch (Exception e) {
e.printStackTrace();
return false;
}
return false;
}
/*
* @author tim update infomation of one test to the Table "text1" by the
* attribute of courseType
*/
public boolean updateText1Table(CtextTestBean text) {
try {
sql = "update text1 set TEXT_QUESTION= '" + text.getText_question()
+ "' ," + "TEXT_ANSWER= '" + text.getText_answer() + "' "
+ " WHERE TEXT_ID=" + text.getText_id();
if (con == null) {
DBConn(); // 连接
}
if (this.executeUpdate(sql) != 0) {
executeUpdate("commit");
return true;
}
} catch (Exception e) {
e.printStackTrace();
return false;
}
return false;
}
/*
* @author tim insert infomation of one test to the Table "text2" by the
* attribute of courseType
*/
public boolean insertIntoText2Table(CtextTestBean text) {
try {
sql = "insert into text2 values ( "// + text.getText_id() + ", "
+ text.getL_id() + ", '" + text.getText_question()
+ "' , '" + text.getText_answer() + "') ";
if (con == null) {
DBConn(); // 连接
}
if (this.executeUpdate(sql) != 0) {
executeUpdate("commit");
return true;
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/*
* @author tim update infomation of one test to the Table "text2" by the
* attribute of courseType
*/
public boolean updateText2Table(CtextTestBean text) {
try {
sql = "update text2 set TEXT_QUESTION= '" + text.getText_question()
+ "' ," + "TEXT_ANSWER= '" + text.getText_answer() + "' "
+ " WHERE TEXT_ID=" + text.getText_id();
if (con == null) {
DBConn(); // 连接
}
if (this.executeUpdate(sql) != 0) {
executeUpdate("commit");
return true;
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/*
* @author tim delete a item of this table
*
*/
public boolean deleteItemOfChoose1Table(String id) {
try {
sql = "delete Choose1 where CH_ID =" + id;
if (con == null) {
DBConn(); // 连接
}
if (this.executeUpdate(
没有合适的资源?快使用搜索试试~ 我知道了~
信息办公学校教务管理系统(jsp+servlet+javabean)-school
共417个文件
java:125个
class:125个
jsp:100个
需积分: 5 0 下载量 65 浏览量
2024-05-13
22:25:07
上传
评论
收藏 4.8MB ZIP 举报
温馨提示
[信息办公]学校教务管理系统(jsp+servlet+javabean)_school
资源推荐
资源详情
资源评论
收起资源包目录
信息办公学校教务管理系统(jsp+servlet+javabean)-school (417个子文件)
Cexam.class 14KB
WeekSchemeMaker.class 11KB
CUsMethod.class 9KB
CmakeTeacherAndCourseTogether.class 8KB
CbestPageBean.class 7KB
AbDoing.class 7KB
CTakeExam.class 7KB
CcheckUser.class 6KB
Page.class 6KB
Lesson2WeekSchemeMaker.class 5KB
SchemeTurnServlet.class 5KB
OneSchemeMaker.class 5KB
OneLesson2ListSchemeMaker.class 4KB
Cexam_giveCompulsoryScore.class 4KB
Cexam_giveElectiveScore.class 4KB
Cexam_uploadTest2Servlet.class 4KB
Cexam_uploadTestServlet.class 4KB
CoperationOfExam.class 3KB
Cexam_uploadOrDeleteTestServlet.class 3KB
CDBConnection.class 3KB
AddNorScore.class 3KB
CcheckUserServlet.class 3KB
CseparateTime.class 3KB
CDBOracle.class 3KB
TiJiaoL2CourseTable.class 3KB
CautoMakeScheme_getLesson1AndTeacherInfo.class 3KB
CgetCurrentTimeFromTimeClassBegin.class 3KB
CflushExam_updateOrDeleteTestServlet.class 3KB
Cexam_updateOrDeleteTestServlet.class 3KB
ShowAllListServlet.class 3KB
ChangeLesson1listServlet.class 3KB
CautoMakeScheme_printCheckedClassAndPhase.class 3KB
DelStuFromClass.class 3KB
CConnectMSSQL.class 3KB
DaySchemeMaker.class 3KB
ChangeTurnServlet.class 3KB
DelTurnServlet.class 3KB
UpdateTeacherInfo.class 3KB
StuResult.class 3KB
CautoMakeScheme_selectTeacherServlet.class 3KB
RegisterTurnServlet.class 2KB
Cexam_uploadOrDeleteCompulsoryChooseServlet.class 2KB
ChangeStudentServlet.class 2KB
Cstudent_updateInfoServlet.class 2KB
CdataFormat.class 2KB
Cexam_uploadOrDeleteElectiveChooseServlet.class 2KB
ChangeLesson2Servlet.class 2KB
DelshowServlet.class 2KB
ModshowServlet.class 2KB
ShowServlet.class 2KB
Update.class 2KB
Cexam_getStudentCourseTocompulsoryPage.class 2KB
Cexam_getStudentCourseToElectivePage.class 2KB
CMethod.class 2KB
ChangeTeacherServlet.class 2KB
ChangeLesson1Servlet.class 2KB
ChangeClassServlet.class 2KB
SchemeUpdateServlet.class 2KB
Cautomakescheme.class 2KB
CchooseTestBean.class 2KB
Cexam_uploadOrDeleteCompulsoryTextServlet.class 2KB
CMethod.class 2KB
Cexam_uploadOrDeleteElectiveTextServlet.class 2KB
Cexam_newPageUpdateChoose2.class 2KB
Cexam_newPageUpdateChoose1.class 2KB
AbUsing.class 2KB
SQL.class 2KB
CourseTable.class 2KB
LoginFilter.class 2KB
CautoMakeScheme_deleteClassAndTeacherForClasses.class 2KB
TeaUpdateServlet.class 2KB
StuUpdateServlet.class 2KB
Cexam_getElectivePaperToElectiveTestPage.class 2KB
Cexam_getCompulsoryPaperToCompulsoryTestPage.class 2KB
ModifyServlet.class 2KB
Cexam_addtestServlet.class 2KB
UpdataServlet.class 2KB
Cexam_addtest2Servlet.class 2KB
AddServlet.class 2KB
DeleteServlet.class 2KB
Lesson2RegisterServlet.class 2KB
DelStudentServlet.class 2KB
StudRegisterServlet.class 2KB
Result2.class 2KB
TeaRegisterServlet.class 2KB
Result.class 2KB
Cstudent_showInfoServlet.class 2KB
PersonalL2Info.class 2KB
Cexam_newPageUpdateText.class 2KB
ClassUpdateServlet.class 2KB
Lesson1RegisterServlet.class 2KB
CreateTime.class 2KB
Lesson2UpdateServlet.class 2KB
Lesson1UpdateServlet.class 2KB
ClassRegisterServlet.class 2KB
Cexam_testExamServlet.class 2KB
CautoMakeScheme_getAllClasses.class 2KB
CstudentBean.class 2KB
DelLesson1Servlet.class 2KB
DelLesson2Servlet.class 2KB
共 417 条
- 1
- 2
- 3
- 4
- 5
资源评论
python资深爱好者
- 粉丝: 243
- 资源: 75
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功