资源简介
我毕业设计自己做的基于web的育儿早教预约系统,获得优秀论文,功能算比较齐全!希望为毕业设计做游戏的同学提供些查考!
代码片段和文件信息
package com.lero.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 com.lero.model.Course;
import com.lero.model.Member;
import com.lero.model.Order;
import com.lero.model.Page;
import com.lero.model.Teacher;
import com.lero.util.DbUtil;
public class CourseDao {
private Connection conn = null;
private PreparedStatement pstm = null;
private ResultSet rs = null;
private DbUtil dbUtil = new DbUtil();
public Boolean insertCourse(Course course) throws Exception {
conn = dbUtil.getCon();
String sql = “insert into t_course(titlecontentimgmoneycoursetimeteacherteacherIdnumcourseNum) values(?????????)“;
try {
pstm=conn.prepareStatement(sql);
pstm.setString(1 course.gettitle());
pstm.setString(2 course.getContent());
pstm.setString(3 course.getImg());
pstm.setFloat(4 course.getMoney());
pstm.setString(5 course.getCoursetime());
pstm.setString(6 course.getTeacher());
pstm.setInt(7 course.getTeacherId());
pstm.setInt(8 course.getNum());
pstm.setInt(9 course.getCourseNum());
return pstm.executeUpdate() > 0;
} catch (SQLException e) {
e.printStackTrace();
} finally {
dbUtil.closeCon(conn pstm rs);
}
return false;
}
public Boolean insertOrder(int courseIdint memberId) throws Exception {
conn = dbUtil.getCon();
String sql = “insert into t_order(courseIdmemberId) values(??)“;
try {
pstm=conn.prepareStatement(sql);
pstm.setInt(1 courseId);
pstm.setInt(2 memberId);
return pstm.executeUpdate() > 0;
} catch (SQLException e) {
e.printStackTrace();
} finally {
dbUtil.closeCon(conn pstm rs);
}
return false;
}
public Boolean updateOrder(Course course) throws Exception {
conn = dbUtil.getCon();
String sql = “update t_course set member=?memberName=? where id=?“;
try {
pstm=conn.prepareStatement(sql);
pstm.setInt(3 course.getId());
return pstm.executeUpdate() > 0;
} catch (SQLException e) {
e.printStackTrace();
} finally {
dbUtil.closeCon(conn pstm rs);
}
return false;
}
public Boolean updateCourse(int id) throws Exception {
conn = dbUtil.getCon();
String sql = “update t_course set num = num-1 where id=?“;
try {
pstm=conn.prepareStatement(sql);
pstm.setInt(1 id);
return pstm.executeUpdate() > 0;
} catch (SQLException e) {
e.printStackTrace();
} finally {
dbUtil.closeCon(conn pstm rs);
}
return false;
}
public Boolean updateCourse_2(int id) {
try {
conn = dbUtil.getCon();
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
String sql = “update t_course set num = num+1 where id=?“;
try {
pstm=conn.prepareStatement(sql);
pstm.setInt(1 id);
return pstm.executeUpdate() > 0;
} catch (SQL
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-04-14 15:11 early_teach\
文件 944 2017-04-14 15:01 early_teach\.classpath
目录 0 2017-04-14 15:11 early_teach\.externalToolBuilders\
文件 548 2017-04-13 22:42 early_teach\.externalToolBuilders\org.eclipse.wst.jsdt.core.ja
文件 548 2017-04-14 15:01 early_teach\.externalToolBuilders\org.eclipse.wst.jsdt.core.ja
文件 1495 2017-04-14 15:02 early_teach\.project
目录 0 2017-04-14 15:11 early_teach\.settings\
文件 503 2017-04-12 10:07 early_teach\.settings\.jsdtscope
文件 1009 2017-04-14 15:01 early_teach\.settings\com.genuitec.eclipse.j2eedt.core.prefs
文件 57 2017-04-13 22:45 early_teach\.settings\org.eclipse.core.resources.prefs
文件 364 2017-04-12 10:07 early_teach\.settings\org.eclipse.jdt.core.prefs
文件 487 2017-04-14 15:01 early_teach\.settings\org.eclipse.wst.common.component
文件 345 2017-04-12 10:07 early_teach\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2017-04-12 10:07 early_teach\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2017-04-12 10:07 early_teach\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2017-04-13 23:10 early_teach\bin\
目录 0 2017-04-14 15:11 early_teach\build\
目录 0 2017-04-14 15:11 early_teach\build\classes\
目录 0 2017-04-14 15:11 early_teach\build\classes\com\
目录 0 2017-04-14 15:11 early_teach\build\classes\com\lero\
目录 0 2017-04-14 15:11 early_teach\build\classes\com\lero\dao\
文件 18005 2017-04-14 15:01 early_teach\build\classes\com\lero\dao\CourseDao.class
文件 6382 2017-04-14 15:01 early_teach\build\classes\com\lero\dao\LeaveDao.class
文件 5840 2017-04-14 15:01 early_teach\build\classes\com\lero\dao\MemberDao.class
文件 5163 2017-04-14 15:01 early_teach\build\classes\com\lero\dao\TeacherDao.class
文件 4055 2017-04-14 15:01 early_teach\build\classes\com\lero\dao\UserDao.class
目录 0 2017-04-14 15:11 early_teach\build\classes\com\lero\filter\
文件 2117 2017-04-14 15:01 early_teach\build\classes\com\lero\filter\LoginFilter.class
目录 0 2017-04-14 15:11 early_teach\build\classes\com\lero\model\
文件 4333 2017-04-14 15:01 early_teach\build\classes\com\lero\model\Course.class
文件 2243 2017-04-14 15:01 early_teach\build\classes\com\lero\model\Leave.class
............此处省略365个文件信息
评论
共有 条评论