基于javaweb+mysql的火车票网上订票系统(前台、后台)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

前台功能:用户查询车票信息、登录注册、购票、查看已购车票、修改密码等功能。

后台功能:管理员管理、用户管理、火车信息管理、站点信息管理、线路信息管理、车票信息管理、购票信息管理等。

后台:

前台

技术框架

JSP Servlet MySQL JDBC Tomcat CSS JavaScript


  * @param request the request send by the client to the server* @param response the response send by the server to the client* @throws ServletException if an error occurred* @throws IOException if an error occurred*/public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {request.setCharacterEncoding("utf-8");response.setCharacterEncoding("utf-8");response.setContentType("text/html");String id=request.getParameter("idi");String flgs=request.getParameter("flgs");JSONObject json=new JSONObject();DbConn db=new DbConn();if("fk".equals(flgs)){int bls=db.deleteOrUpdate("update dpiao set lyflag='已付款' where id="+id);if(bls>0){json.put("dt", 1);json.put("msg", "付款成功。");}else{json.put("dt", 0);json.put("msg", "fkerror:01");}}else if("gq".equals(flgs)){//改签
  * 读取Properties综合类,默认绑定到temp下的.properties文件。*/public class HandleProperties {//配置文件的路径private String configPath=null;/*** 配置文件对象*/private Properties props=null;/*** 默认构造函数,用于sh运行,自动找到temp下的.properties。*/public HandleProperties(HttpSession session,String fname) throws IOException{String path=session.getServletContext().getRealPath("/");File f=new File(path+"prop/"+fname+".properties");if(!f.exists()){f.getParentFile().mkdirs();}if(!f.exists()){try {f.createNewFile();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();
         var czi=$("#gcz").val();var xcnumsi=$("#gxcnums").val();var traintypei=$("#gtraintype").val();var ids=$("#idi").val();var flag=$("#flagi").val();if(tnamei==""||czi==""||znumsi==""||xcnumsi==""){alert('账户信息不完整。');return;}if("add"==flag){$.ajax({url:'Add',type:'post',data:{tname:'traininfo',tnames:tnamei,znums:znumsi,cz:czi,xcnums:xcnumsi,traintype:traintypei},dataType:'json',success:function(data){alert(data.msg);
/*** Constructor of the object.*/public LoginSvlt() {super();}/*** Destruction of the servlet. <br>*/public void destroy() {super.destroy(); // Just puts "destroy" string in log// Put your code here}/*** The doGet method of the servlet. <br>*
                                     </td><td><input type="button" value="添  加" onclick="addbt();"/></td></tr></table></td></tr><tr><td align="center" valign="top"><div id="nrdiv"><table border="0" cellpadding="0" cellspacing="0" class="mytable"><tr><td colspan="9" align="center">${dlmsg }</td></tr><tr bgcolor="#4a4a4a"><th width="50px"  style="color:white;">ID</th><th width="150px"  style="color:white;">车次</th><th width="100px"  style="color:white;">车长</th><th width="100px"  style="color:white;">总座位数</th><th width="100px"  style="color:white;">限乘人数</th><th width="100px"  style="color:white;">火车类型</th><th width="60px"  style="color:white;">修改</th><th width="60px"  style="color:white;">删除</th></tr>
             if(!bl){json.put("msg", "添加成功。");}else{json.put("msg", "添加失败");}}}//站点信息添加if("zhandian".equals(tname)){String zdname=request.getParameter("zdname");boolean bl=db.checkTrue("select id from zhandian where zdname='"+zdname+"'");if(bl){json.put("msg", "站点名称已存在");}else{bl=db.insort("insert into zhandian(zdname) values('"+zdname+"')");if(!bl){json.put("msg", "添加成功。");
        Resize();});function Resize() {var wintop = ($(window).height() - 400) / 2;var winleft = ($(window).width() - 600) / 2;if (wintop > 0) {$("#win").css("top", wintop + "px");}if (winleft > 0) {$("#win").css("left", winleft + "px");}$("#div1").offset({ top: $("#td1").offset().top + 31, left: $("#td1").offset().left + 1 });$("#div2").offset({ top: $("#td1").offset().top + 30, left: $("#td1").offset().left });
        {font-family: "宋体";font-size: 9pt;margin: 100px auto auto auto;}table{font-family: "宋体";font-size: 9pt;}</style>
</head>
<script type="text/javascript" src="<%=basePath %>/Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript">$(document).ready(function () {$(window).resize(Resize);Resize();});function Resize() {var wintop = ($(window).height() - 400) / 2;
         }else{json.put("msg", "操作错误01");}}//顾客信息修改if("cusinfo".equals(tname)){String un=request.getParameter("cidcard");String up=request.getParameter("cpassword");String um=request.getParameter("cname");String ids=request.getParameter("idi");ResultSet rs=db.query("select id from cusinfo where cidcard='"+un+"'");if(rs!=null){boolean bl=false;int id=-1;try {while(rs.next()){id=rs.getInt("id");if(!String.valueOf(id).equals(ids)){
 }/*** Initialization of the servlet. <br>** @throws ServletException if an error occurs*/public void init() throws ServletException {// Put your code here}}
package dp.svlt;
                 a.setTraintype(rs.getString("traintype"));String yx=rs.getString("yxsj");if(yx.length()>10){yx=yx.substring(0,10);}a.setYxsj(yx);alist.add(a);}} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}}return alist;}//将结果集转化成链表public static List<Cusinfo> getCusinfo(ResultSet rs){List<Cusinfo> alist=new ArrayList();if(rs!=null){try {rs.beforeFirst();while(rs.next()){Cusinfo a=new Cusinfo();a.setId(rs.getInt("id"));a.setCidcard(rs.getString("cidcard"));a.setCname(rs.getString("cname"));a.setCpassword(rs.getString("cpassword"));
                 alist.add(a);}} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}}return alist;}//将结果集转化成链表public static List<Zhandian> getZhandians(ResultSet rs){List<Zhandian> alist=new ArrayList();if(rs!=null){try {rs.beforeFirst();while(rs.next()){Zhandian a=new Zhandian();a.setId(rs.getInt("id"));a.setXh(rs.getInt("xh"));a.setZdname(rs.getString("zdname"));alist.add(a);}} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();
    <title>火车信息管理</title><meta http-equiv="pragma" content="no-cache"><meta http-equiv="cache-control" content="no-cache"><meta http-equiv="expires" content="0">    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"><meta http-equiv="description" content="This is my page"><link rel="stylesheet" type="text/css" href="<%=basePath %>css/cstype.css"><link rel="stylesheet" type="text/css" href="<%=basePath %>css/mytable.css"><script type="text/javascript" src="<%=basePath %>js/jquery.js"></script><script type="text/javascript" src="<%=basePath %>js/common.js"></script><script type="text/javascript">function addbt(){$("#flagi").val("add");$("#gtname").val("");$("#gcz").val("");$("#gznums").val("");$("#gxcnums").val("");dshow();$("#gldiv").show();}function delbt(id){            if(confirm("你确定要删除该信息么?")){$.ajax({url:'Del',
 }/*** The doGet method of the servlet. <br>** This method is called when a form has its tag value method equals to get.* * @param request the request send by the client to the server* @param response the response send by the server to the client* @throws ServletException if an error occurred* @throws IOException if an error occurred*/public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {this.doPost(request, response);}/*** The doPost method of the servlet. <br>** This method is called when a form has its tag value method equals to post.*
             json.put("msg", "修改失败");}}PrintWriter out=response.getWriter();out.print(json.toString());out.flush();out.close();}/*** Initialization of the servlet. <br>** @throws ServletException if an error occurs*/public void init() throws ServletException {// Put your code here}}
package dp.admin.svlt;
















基于javaweb+mysql的火车票网上订票系统(前台、后台)相关推荐

  1. Java基于jsp的火车票网上订票系统

    信息数字化进程加快,网络的普及带动了电脑手机的飞速发展,电脑端各种网站的覆盖,手机端各种APP的出现给人们的生活带来巨大变革.在这些年体会最明显的就是无现金支付,不论去哪里,不论购买什么都可以用一部手 ...

  2. 基于jsp的火车票网上订票系统

    对于购买火车票来讲,利用计算机软件技术开发一款基于JSP的火车票订票系统可以让用户更加方便快捷的购买对应的火车票信息,方便了用户的出行.让网站用户只要登录进去基于JSP的火车票订票系统就可以查看所有的 ...

  3. java火车票预订系统代码_基于JSP开发火车票网上订票系统 java源码

    今天给大家演示的是一款由jsp+servlet+mysql实现的火车票预定管理系统,该系统主要实现的功能有:前台功能:用户查询车票信息.登录注册.购票.查看已购车票.修改密码等功能,后台管理功能:管理 ...

  4. 基于SSM实现的演唱会网上订票系统-JAVA【毕业设计、快速开发、源码、开题报告】

    功能介绍 系统中的核心用户是系统管理员,管理员登录后,主要功能有管理员信息管理.网站用户管理.新闻公告信息管理.演唱会类型信息管理.演唱会信息管理.票务信息管理.订单信息管理. 用户登录后,主要功能模 ...

  5. 网上订票系统数据库c语言实现,基于c 的火车票订票管理系统的设计与实现.docx...

    基于c 的火车票订票管理系统的设计与实现 毕 业 设 计题目基于C#的火车票订票管理系统的设计与实现姓 名 周建华 学 号 201304150001 系(院)信息工程系 班 级P13软件技术1班指导教 ...

  6. 基于SSM的演唱会网上订票系统

    <基于SSM+Bootstrap+MYSQL演唱会网上订票系统> 后台框架:Spring.SpringMVC.MyBatis 数据库:MySQL 系统中的核心用户是系统管理员,管理员登录后 ...

  7. javaweb基于JSP+Servlet开发北京市地铁(火车票)订票系统+论文+PPT+任务书+检查表 毕业设计

    基于JSP+Servlet开发北京市地铁(火车票)订票系统+论文+PPT+任务书+检查表:(毕业设计/课程设计) 开发工具: MyEclipse+Jdk+Tomcat+MySQL数据库 运行效果图 基 ...

  8. 基于Java毕业设计新疆旅游专列订票系统源码+系统+mysql+lw文档+部署软件

    基于Java毕业设计新疆旅游专列订票系统源码+系统+mysql+lw文档+部署软件 基于Java毕业设计新疆旅游专列订票系统源码+系统+mysql+lw文档+部署软件 本源码技术栈: 项目架构:B/S ...

  9. 【JAVA程序设计】【C00106】基于SSM(非maven)的演唱会网上订票系统——有文档

    [C00106]基于SSM(非maven)的演唱会网上订票系统--有文档 项目简介 项目获取 开发环境 项目技术 运行截图 项目简介 基于SSM+Bootstrap+MYSQL演唱会网上订票系统分为二 ...

最新文章

  1. 2022-2028年中国AKD施胶剂行业市场研究及前瞻分析报告
  2. Xenapp安装后手动更改XML Service端口,以便使用不同于 IIS 的端口
  3. 利用?和 ??简化界面的默认配置/自定义配置
  4. T(n) = 25T(n/5)+n^2的时间复杂度 计算方法
  5. Spring Validation校验
  6. 数据库-MySQL-配置和管理-用户与授权GRANT
  7. 日历2019全年日历表_实施和使用日历表
  8. [TimLinux] scrapy 在Windows平台的安装
  9. OpenCV特征检测与匹配方法概览
  10. SecureCRT键盘无法输入
  11. 光衰高怎么办_发光顶角线使用起来方便吗?维护成本高吗?
  12. debian 屌丝日记
  13. Cesium 添加边界墙边界线
  14. Linux篇【3】:Linux环境基础开发工具使用(中)
  15. 互联网晚报 | 9月15日 星期三 | iPhone 13正式发布;天猫双11正式启动商家报名;华为推出鸿蒙矿山操作系统“矿鸿”...
  16. 在linux服务器上用headless firefox打开中文网页,字体乱码问题
  17. 利用frm和idb文件恢复mysql数据
  18. gpu云服务器支持,GPU云服务器产品简介
  19. 使用yanderify搞个图片转视频(让大头照动起来)
  20. Android 文件下载,根据url获取真正的文件名和后缀名(包括重定向的url)

热门文章

  1. Pyecharts数据可视化实战 | 分析CSDN周排Top100博主
  2. verilog状态机 三段式 状态机 (代码 可以运行)
  3. 湖北民族学院c语言试卷,C实验参考答案(湖北民族学院计算机c语言课后习题答案)..doc...
  4. 每天定时发送邮件提醒
  5. [js进阶]原生js实现addClass,removeClass,hasClass方法
  6. L1-028 判断素数 (10 分)
  7. matlab中sort(),atan2(y,x),normrnd(),boxplot()函数,cell数组用法学习
  8. 墨天轮【2022年新春发布会暨国产数据库年度颁奖典礼】圆满收官
  9. PC桌面应用开发选择
  10. kali实战:断网攻击