• 大小: 978KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-14
  • 语言: Java
  • 标签: JSP  mysql  servlet  

资源简介

JSP课程设计个人信息系统 JSP mysql servlet

资源截图

代码片段和文件信息

package dateManager;

import java.io.IOException;
import java.sql.*;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.swing.JOptionPane;
import loginRegister.LoginBean;

public class AddDateServlet extends HttpServlet {
     
private static final long serialVersionUID = 1L;

public void wrong1(){
        String msg=“请把日期填写完整,添加失败!“;
        int type=JOptionPane.YES_NO_CANCEL_OPTION;
        String title=“信息提示“;
        JOptionPane.showMessageDialog(null msg title type);
    }
    public void wrong2(){
        String msg=“请确认日期填写正确,添加失败!“;
        int type=JOptionPane.YES_NO_CANCEL_OPTION;
        String title=“信息提示“;
        JOptionPane.showMessageDialog(null msg title type);
    }
    public void wrong3(){
        String msg=“请填写日程内容,添加失败!“;
        int type=JOptionPane.YES_NO_CANCEL_OPTION;
        String title=“信息提示“;
        JOptionPane.showMessageDialog(null msg title type);
    }
    public void wrong4(){
        String msg=“该日程已有计划,添加失败!“;
        int type=JOptionPane.YES_NO_CANCEL_OPTION;
        String title=“信息提示“;
        JOptionPane.showMessageDialog(null msg title type);
    }
    public void right(){
        String msg=“填写信息合格,添加成功!“;
        int type=JOptionPane.YES_NO_CANCEL_OPTION;
        String title=“信息提示“;
        JOptionPane.showMessageDialog(null msg title type);
    }
    @Override
    protected void doGet(HttpServletRequest request HttpServletResponse response)
    throws ServletException IOException {
        String year=new String(request.getParameter(“year“).getBytes(“ISO-8859-1“)“UTF-8“);
        String month=new String(request.getParameter(“month“).getBytes(“ISO-8859-1“)“UTF-8“);
        String day=new String(request.getParameter(“day“).getBytes(“ISO-8859-1“)“UTF-8“);
        String thing=new String(request.getParameter(“thing“).getBytes(“ISO-8859-1“)“UTF-8“);
        String date=“20“+year+“-“+month+“-“+year;
        if(year.length()==0||month.length()==0||day.length()==0){
            wrong1();
            response.sendRedirect(“http://localhost:8080/PIMS/dateManager/addDate.jsp“);
        }else if(year.length()!=2||Integer.parseInt(year)<11||Integer.parseInt(month)<1||Integer.parseInt(month)>12||Integer.parseInt(day)<1||Integer.parseInt(day)>31){
            wrong2();
            response.sendRedirect(“http://localhost:8080/PIMS/dateManager/addDate.jsp“);
        }else if(thing.length()==0){
            wrong3();
            response.sendRedirect(“http://localhost:8080/PIMS/dateManager/addDate.jsp“);
        }else{
            try{
                Connection con=null;
                Statement stmt=null;
                ResultSet rs=null;
                Class.forName(“com.mysql.jdbc.Driver“);
                String url=“jdbc:mysql://localhost:3306/person?useUnicode=true&characterEncoding=gbk“;

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        529  2014-06-11 09:59  PIMS\.classpath

     文件        285  2014-06-11 09:59  PIMS\.mymetadata

     文件       1747  2014-06-11 10:00  PIMS\.project

     文件       2830  2014-06-11 10:14  PIMS\WebRoot\login.jsp

     文件       2595  2013-03-31 20:08  PIMS\WebRoot\person.sql

     文件       5467  2014-06-11 10:03  PIMS\WebRoot\WEB-INF\web.xml

     文件     527090  2012-03-20 21:16  PIMS\WebRoot\WEB-INF\lib\mysql-connector-java-5.0.6-bin.jar

     文件       2016  2014-06-11 10:05  PIMS\WebRoot\WEB-INF\classes\lookMessage\LookMessageBean.class

     文件       3283  2014-06-11 10:30  PIMS\WebRoot\WEB-INF\classes\lookMessage\LookMessageServlet.class

     文件       4876  2014-06-11 10:30  PIMS\WebRoot\WEB-INF\classes\lookMessage\UpdateMessageServlet.class

     文件       4453  2014-06-11 10:30  PIMS\WebRoot\WEB-INF\classes\lookMessage\UpdatePasswordServlet.class

     文件        740  2014-06-11 10:05  PIMS\WebRoot\WEB-INF\classes\loginRegister\LoginBean.class

     文件       4270  2014-06-11 10:28  PIMS\WebRoot\WEB-INF\classes\loginRegister\LoginServlet.class

     文件       4799  2014-06-11 10:16  PIMS\WebRoot\WEB-INF\classes\loginRegister\RegisterServlet.class

     文件       5397  2014-06-11 11:00  PIMS\WebRoot\WEB-INF\classes\friendManager\AddFriendServlet.class

     文件       5107  2014-06-11 11:01  PIMS\WebRoot\WEB-INF\classes\friendManager\DeleteFriendServlet.class

     文件       1473  2014-06-11 11:01  PIMS\WebRoot\WEB-INF\classes\friendManager\LookFriendBean.class

     文件       3947  2014-06-11 11:03  PIMS\WebRoot\WEB-INF\classes\friendManager\LookFriendServlet.class

     文件        551  2014-06-11 10:20  PIMS\WebRoot\WEB-INF\classes\friendManager\UpdateFriendBean.class

     文件       5257  2014-06-11 11:02  PIMS\WebRoot\WEB-INF\classes\friendManager\UpdateFriendMessageServlet.class

     文件       4294  2014-06-11 10:19  PIMS\WebRoot\WEB-INF\classes\friendManager\UpdateFriendServlet.class

     文件       1661  2014-06-11 10:19  PIMS\WebRoot\WEB-INF\classes\fileManager\FileUpServlet.class

     文件       5636  2014-06-11 10:55  PIMS\WebRoot\WEB-INF\classes\dateManager\AddDateServlet.class

     文件       5439  2014-06-11 10:17  PIMS\WebRoot\WEB-INF\classes\dateManager\DeleteDateServlet.class

     文件        724  2014-06-11 10:18  PIMS\WebRoot\WEB-INF\classes\dateManager\LookDateBean.class

     文件       3370  2014-06-11 10:59  PIMS\WebRoot\WEB-INF\classes\dateManager\LookDateServlet.class

     文件       5626  2014-06-11 10:57  PIMS\WebRoot\WEB-INF\classes\dateManager\UpdateDateServlet.class

     文件      15452  2014-06-11 10:23  PIMS\WebRoot\register\register.jsp

     文件         85  2012-03-20 01:17  PIMS\WebRoot\meta-INF\context.xml

     文件        261  2014-06-11 10:15  PIMS\WebRoot\main\bottom.jsp

............此处省略77个文件信息

评论

共有 条评论