• 大小: 2.76MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-13
  • 语言: Java
  • 标签: java  日程管理  

资源简介

基于myeclipse sql2005的java程序 实现了用户的注册,日程的添加、删除、修改等功能

资源截图

代码片段和文件信息

package com.prog.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.prog.database.SqlHelp;
import com.prog.entity.TaskBean;

public class TaskDao {

/***
 * 得到List集合
 * @author Administrator
 *
 */
public List getListtask(String sql){

List list = new ArrayList();
ResultSet rs = SqlHelp.executeQuery(sql);
try {
while(rs.next()){
TaskBean task = new TaskBean();
Date date=new Date();
task.setMTaskId(rs.getString(1));
task.setMTaskUserId(rs.getString(2));
task.setMTeskBuildDate(rs.getString(3));
task.setMTaskTopic(rs.getString(4));
task.setMTaskDate(rs.getString(5));
task.setMTaskEnddate(rs.getString(6));
task.setMTaskGory(rs.getString(7));
task.setMTaskInfo(rs.getString(8));
task.setMTaskIstask(rs.getString(9));
task.setMTaskIsend(rs.getString(10));
list.add(task);
}
} catch (SQLException e) {
e.printStackTrace();
}
return list;
}
/**
 * 日程管理的插入方法
 * @param sd
 * @return
 */
public Connection con;
private PreparedStatement pstat;
String sql = ““;

public int InertRc(TaskBean task){
SqlHelp db = new SqlHelp();
con = db.getConnection();
sql = “insert into t_task_rc(m_task_idm_task_user_idm_task_buildDate“
+“m_task_topicm_task_datem_task_enddatem_task_gory“ 
+“m_task_infom_task_istaskm_task_isend) values(??????????)“;
try {
pstat = con.prepareStatement(sql);
pstat.setString(1 task.getMTaskId());
pstat.setString(2 task.getMTaskUserId());
pstat.setString(3 task.getMTeskBuildDate());
pstat.setString(4task.getMTaskTopic());
pstat.setString(5task.getMTaskDate());
pstat.setString(6task.getMTaskEnddate());
pstat.setString(7task.getMTaskGory());
pstat.setString(8task.getMTaskInfo());
pstat.setString(9 task.getMTaskIstask());
pstat.setString(10 task.getMTaskIsend());
pstat.executeUpdate();
pstat.close();
con.close();
} catch (SQLException e) {
e.printStackTrace();
}
return 0;
}

/***
 * 显示日程里面进行修改
 * @param task
 * @return
 */
public  int updateTask(TaskBean task){
Connection con;
PreparedStatement pstat;
String sql = ““;
SqlHelp db = new SqlHelp();
con = db.getConnection();
sql = “update t_task_rc set m_task_buildDate=?m_task_topic=?m_task_date=?“ 
+“m_task_enddate=?m_task_gory=?m_task_info=?m_task_istask=?m_task_isend=?“ 
+“ where m_task_id=?“;
try {
pstat = con.prepareStatement(sql);
pstat.setString(1 task.getMTeskBuildDate());
pstat.setString(2task.getMTaskTopic());
pstat.setString(3task.getMTaskDate());
pstat.setString(4task.getMTaskEnddate());
pstat.setString(5task.getMTaskGory());
pstat.setString(6task.getMTaskInfo());
ps

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件     3145728  2012-05-28 13:20  demo.mdf
     文件     1048576  2012-05-28 13:20  demo_log.ldf
     目录           0  2012-06-24 21:30  program\
     文件        1032  2012-06-24 21:34  program\.classpath
     目录           0  2012-06-01 17:31  program\.myeclipse\
     文件         294  2012-06-26 22:23  program\.mymetadata
     文件        1280  2012-05-06 19:20  program\.project
     目录           0  2012-06-24 21:30  program\.settings\
     文件          98  2012-05-07 22:19  program\.settings\org.eclipse.core.resources.prefs
     目录           0  2012-06-24 21:30  program\src\
     目录           0  2012-06-24 21:30  program\src\com\
     目录           0  2012-06-24 21:30  program\src\com\prog\
     目录           0  2012-06-24 21:30  program\src\com\prog\dao\
     目录           0  2012-06-24 21:30  program\src\com\prog\dao\impl\
     文件         143  2012-05-12 16:05  program\src\com\prog\dao\impl\UserLoginDao.java
     文件         941  2012-05-17 15:49  program\src\com\prog\dao\impl\UserLoginDaoimpl.java
     文件        3871  2012-05-25 13:10  program\src\com\prog\dao\TaskDao.java
     文件        1799  2012-01-01 01:51  program\src\com\prog\dao\UserDao.java
     目录           0  2012-06-24 21:30  program\src\com\prog\database\
     文件         313  2012-01-01 01:50  program\src\com\prog\database\DAOFactory.java
     文件        1696  2012-05-25 13:09  program\src\com\prog\database\SqlHelp.java
     目录           0  2012-06-24 21:30  program\src\com\prog\entity\
     文件        1798  2012-05-25 13:11  program\src\com\prog\entity\TaskBean.java
     文件        2218  2012-05-25 13:11  program\src\com\prog\entity\UserBean.java
     目录           0  2012-06-01 17:31  program\src\com\prog\pojo\
     目录           0  2012-06-24 21:30  program\src\com\prog\servlet\
     文件        2251  2012-01-01 01:49  program\src\com\prog\servlet\LoginOutServlet.java
     文件        6186  2012-01-01 01:59  program\src\com\prog\servlet\ProgramServlet.java
     文件        1620  2012-01-01 01:54  program\src\com\prog\servlet\UserInsertServlet.java
     文件        2310  2012-05-25 13:07  program\src\com\prog\servlet\UserLoginServlet.java
     目录           0  2012-06-24 21:30  program\WebRoot\
............此处省略81个文件信息

评论

共有 条评论