一、源码特点
idea开发 java servlet 汽车租赁管理系统是一套完善的web设计系统sqlserver数据库 系统采用serlvet+dao+bean mvc 模式开发,对理解JSP java编程开发语言有帮助,系统具有完整的源代码和数据库,系统主要采用B/S模式开发。
java servlet 汽车租赁平台1
二、功能介绍
(1)管理员管理:对管理员信息进行添加、删除、修改和查看
(2)用户管理:对用户信息进行添加、删除、修改和查看
(3)司机管理:对司机信息进行添加、删除、修改和查看
(4)车辆类型管理:对车辆类型信息进行添加、删除、修改和查看
(5)车辆管理:对车辆信息进行添加、删除、修改和查看
(6)修理厂管理:对修理厂信息进行添加、删除、修改和查看
(7)维修管理:对维修信息进行添加、删除、修改和查看
(8)预约管理:对预约信息进行添加、删除、修改和查看
(9)个人信息修改
数据库设计
BEGIN
CREATE TABLE [dbo].[gly]([glyid] [int] IDENTITY(1,1) NOT NULL,
[yhm] [VARCHAR](40),
[mm] [VARCHAR](40),
[xm] [VARCHAR](40),
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'gly', @level2type=N'COLUMN', @level2name=N'yhm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'密码' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'gly', @level2type=N'COLUMN', @level2name=N'mm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'姓名' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'gly', @level2type=N'COLUMN', @level2name=N'xm'
BEGIN
CREATE TABLE [dbo].[yonghu]([yhid] [int] IDENTITY(1,1) NOT NULL,
[yhm] [VARCHAR](40),
[mm] [VARCHAR](40),
[xm] [VARCHAR](40),
[lxdh] [VARCHAR](40),
[lxdz] [VARCHAR](40),
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yonghu', @level2type=N'COLUMN', @level2name=N'yhm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'密码' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yonghu', @level2type=N'COLUMN', @level2name=N'mm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'姓名' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yonghu', @level2type=N'COLUMN', @level2name=N'xm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系电话' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yonghu', @level2type=N'COLUMN', @level2name=N'lxdh'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系地址' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yonghu', @level2type=N'COLUMN', @level2name=N'lxdz'
BEGIN
CREATE TABLE [dbo].[siji]([sjid] [int] IDENTITY(1,1) NOT NULL,
[yhm] [VARCHAR](40),
[mm] [VARCHAR](40),
[xm] [VARCHAR](40),
[lxdh] [VARCHAR](40),
[lxdz] [VARCHAR](40),
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'siji', @level2type=N'COLUMN', @level2name=N'yhm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'密码' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'siji', @level2type=N'COLUMN', @level2name=N'mm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'姓名' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'siji', @level2type=N'COLUMN', @level2name=N'xm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系电话' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'siji', @level2type=N'COLUMN', @level2name=N'lxdh'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系地址' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'siji', @level2type=N'COLUMN', @level2name=N'lxdz'
BEGIN
CREATE TABLE [dbo].[cllx]([cllxid] [int] IDENTITY(1,1) NOT NULL,
[lx] [VARCHAR](40),
[fy] [VARCHAR](40),
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'cllx', @level2type=N'COLUMN', @level2name=N'lx'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'费用' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'cllx', @level2type=N'COLUMN', @level2name=N'fy'
BEGIN
CREATE TABLE [dbo].[cheliang]([clid] [int] IDENTITY(1,1) NOT NULL,
[clh] [VARCHAR](40),
[lx] [VARCHAR](40),
[pp] [VARCHAR](40),
[clzt] [VARCHAR](40),
[js] [VARCHAR](40),
[sj] [VARCHAR](40),
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'车辆号' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'cheliang', @level2type=N'COLUMN', @level2name=N'clh'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'cheliang', @level2type=N'COLUMN', @level2name=N'lx'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'品牌' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'cheliang', @level2type=N'COLUMN', @level2name=N'pp'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'车辆状态' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'cheliang', @level2type=N'COLUMN', @level2name=N'clzt'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'介绍' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'cheliang', @level2type=N'COLUMN', @level2name=N'js'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'司机' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'cheliang', @level2type=N'COLUMN', @level2name=N'sj'
BEGIN
CREATE TABLE [dbo].[xlc]([xlcid] [int] IDENTITY(1,1) NOT NULL,
[xlcmc] [VARCHAR](40),
[wz] [VARCHAR](40),
[lxdh] [VARCHAR](40),
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修理厂名称' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'xlc', @level2type=N'COLUMN', @level2name=N'xlcmc'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'位置' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'xlc', @level2type=N'COLUMN', @level2name=N'wz'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系电话' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'xlc', @level2type=N'COLUMN', @level2name=N'lxdh'
BEGIN
CREATE TABLE [dbo].[weixiu]([wxid] [int] IDENTITY(1,1) NOT NULL,
[qc] [VARCHAR](40),
[xlc] [VARCHAR](40),
[zy] [VARCHAR](40),
[wxms] [VARCHAR](40),
[wxsj] [VARCHAR](40),
[yh] [VARCHAR](40),
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'汽车' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'weixiu', @level2type=N'COLUMN', @level2name=N'qc'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修理厂' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'weixiu', @level2type=N'COLUMN', @level2name=N'xlc'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'摘要' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'weixiu', @level2type=N'COLUMN', @level2name=N'zy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'维修描述' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'weixiu', @level2type=N'COLUMN', @level2name=N'wxms'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'维修时间' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'weixiu', @level2type=N'COLUMN', @level2name=N'wxsj'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'weixiu', @level2type=N'COLUMN', @level2name=N'yh'
BEGIN
CREATE TABLE [dbo].[yuyue]([yyid] [int] IDENTITY(1,1) NOT NULL,
[dh] [VARCHAR](40),
[lx] [VARCHAR](40),
[dj] [VARCHAR](40),
[zj] [VARCHAR](40),
[qsd] [VARCHAR](40),
[mdd] [VARCHAR](40),
[yysj] [VARCHAR](40),
[yh] [VARCHAR](40),
[bz] [VARCHAR](40),
[kssj] [VARCHAR](40),
[jssj] [VARCHAR](40),
[zsz] [VARCHAR](40),
[sj] [VARCHAR](40),
[cl] [VARCHAR](40),
[zt] [VARCHAR](40),
) ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单号' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yuyue', @level2type=N'COLUMN', @level2name=N'dh'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yuyue', @level2type=N'COLUMN', @level2name=N'lx'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单价' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yuyue', @level2type=N'COLUMN', @level2name=N'dj'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'总价' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yuyue', @level2type=N'COLUMN', @level2name=N'zj'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'起始地' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yuyue', @level2type=N'COLUMN', @level2name=N'qsd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'目的地' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yuyue', @level2type=N'COLUMN', @level2name=N'mdd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'预约时间' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yuyue', @level2type=N'COLUMN', @level2name=N'yysj'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yuyue', @level2type=N'COLUMN', @level2name=N'yh'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yuyue', @level2type=N'COLUMN', @level2name=N'bz'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开始时间' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yuyue', @level2type=N'COLUMN', @level2name=N'kssj'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'结束时间' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yuyue', @level2type=N'COLUMN', @level2name=N'jssj'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'总时长' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yuyue', @level2type=N'COLUMN', @level2name=N'zsz'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'司机' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yuyue', @level2type=N'COLUMN', @level2name=N'sj'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'车辆' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yuyue', @level2type=N'COLUMN', @level2name=N'cl'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'yuyue', @level2type=N'COLUMN', @level2name=N'zt'
代码设计
private void insertM(HttpServletRequest request, HttpServletResponse response){//车辆添加cheliangDao dao=new cheliangDao();cheliang cheliang=new cheliang();cheliang.setClid((String)request.getParameter("keyid"));
String clh=(String)request.getParameter("clh");//车辆号
cheliang.setClh(clh);
String lx=(String)request.getParameter("lx");//类型
cheliang.setLx(lx);
String pp=(String)request.getParameter("pp");//品牌
cheliang.setPp(pp);
String clzt=(String)request.getParameter("clzt");//车辆状态
cheliang.setClzt(clzt);
String js=(String)request.getParameter("js");//介绍
cheliang.setJs(js);
String sj=(String)request.getParameter("sj");//司机
cheliang.setSj(sj);response.setCharacterEncoding("gb2312");//设置字符集 仿制乱码String sql="";ResultSet rs=null;int num=0;DBO db=new DBO();try {sql="select count(1) as num from cheliang where clh='"+clh+"'";rs=db.query(sql);if(rs.next()){num=rs.getInt("num");}if(num>0){request.setAttribute("flag", "操作失败、车辆号重复");}else{dao.insert(cheliang);request.setAttribute("flag", "操作成功");}request.getRequestDispatcher("cheliang/cheliangadd.jsp").forward(request, response);} catch (Exception e) {e.printStackTrace();}}private void ListM(HttpServletRequest request, HttpServletResponse response){//车辆信息列表ResultSet rs=null;cheliangDao dao = new cheliangDao();System.out.println("alist");String sql="";response.setCharacterEncoding("gb2312");//设置字符集 仿制乱码try{String clh=(String)request.getParameter("clh");//车辆号if(clh!=null&&!clh.equals("")){sql+=" and clh like '%"+clh+"%'";//符合条件 拼接sql 车辆号}String lx=(String)request.getParameter("lx");//类型if(lx!=null&&!lx.equals("")){sql+=" and lx like '%"+lx+"%'";//符合条件 拼接sql 类型}String pp=(String)request.getParameter("pp");//品牌if(pp!=null&&!pp.equals("")){sql+=" and pp like '%"+pp+"%'";//符合条件 拼接sql 品牌}String clzt=(String)request.getParameter("clzt");//车辆状态if(clzt!=null&&!clzt.equals("")){sql+=" and clzt like '%"+clzt+"%'";//符合条件 拼接sql 车辆状态}String js=(String)request.getParameter("js");//介绍if(js!=null&&!js.equals("")){sql+=" and js like '%"+js+"%'";//符合条件 拼接sql 介绍}String sj=(String)request.getParameter("sj");//司机if(sj!=null&&!sj.equals("")){sql+=" and sj like '%"+sj+"%'";//符合条件 拼接sql 司机}rs=dao.qlist(sql);PrintWriter out = response.getWriter();request.setAttribute("rs", rs); request.getRequestDispatcher("cheliang/chelianglist.jsp").forward(request, response);}catch(Exception e){e.toString();e.printStackTrace();}}private void PListM(HttpServletRequest request, HttpServletResponse response){//测试信息列表ResultSet rs=null;cheliangDao dao = new cheliangDao();String str=(String)request.getParameter("Page");String sql="";response.setCharacterEncoding("gb2312");//设置字符集 仿制乱码try{if(str==null){str="0";}String clh=(String)request.getParameter("clh");//车辆号if(clh!=null&&!clh.equals("")){sql+=" and clh like '%"+clh+"%'";//符合条件 拼接sql 车辆号}String lx=(String)request.getParameter("lx");//类型if(lx!=null&&!lx.equals("")){sql+=" and lx like '%"+lx+"%'";//符合条件 拼接sql 类型}String pp=(String)request.getParameter("pp");//品牌if(pp!=null&&!pp.equals("")){sql+=" and pp like '%"+pp+"%'";//符合条件 拼接sql 品牌}String clzt=(String)request.getParameter("clzt");//车辆状态if(clzt!=null&&!clzt.equals("")){sql+=" and clzt like '%"+clzt+"%'";//符合条件 拼接sql 车辆状态}String js=(String)request.getParameter("js");//介绍if(js!=null&&!js.equals("")){sql+=" and js like '%"+js+"%'";//符合条件 拼接sql 介绍}String sj=(String)request.getParameter("sj");//司机if(sj!=null&&!sj.equals("")){sql+=" and sj like '%"+sj+"%'";//符合条件 拼接sql 司机}rs=dao.qlist(sql);PrintWriter out = response.getWriter();request.setAttribute("rs", rs); request.getRequestDispatcher("cheliang/chelianginfo.jsp?Page=1").forward(request, response);}catch(Exception e){e.toString();e.printStackTrace();}}private void modifyIndex(HttpServletRequest request, HttpServletResponse response){//车辆修改首页ResultSet rs=null;response.setCharacterEncoding("gb2312");//设置字符集 仿制乱码cheliangDao dao = new cheliangDao();String keyid=(String)request.getParameter("keyid");String sql="";if(keyid!=null&&!keyid.equals("")){sql+=" and clid='"+keyid+"'";}try{rs=dao.qlist(sql);PrintWriter out = response.getWriter();request.setAttribute("rs", rs); request.getRequestDispatcher("cheliang/cheliangmodify.jsp").forward(request, response);//response.sendRedirect("cheliang/cheliangmodify.jsp");}catch(Exception e){e.toString();e.printStackTrace();}}private void detailM(HttpServletRequest request, HttpServletResponse response){//车辆详细信息页面ResultSet rs=null;response.setCharacterEncoding("gb2312");//设置字符集 仿制乱码cheliangDao dao = new cheliangDao();String keyid=(String)request.getParameter("keyid");String sql="";if(keyid!=null&&!keyid.equals("")){sql+=" and clid='"+keyid+"'";}try{rs=dao.qlist(sql);request.setAttribute("rs", rs); request.getRequestDispatcher("cheliang/cheliangdetail.jsp").forward(request, response);}catch(Exception e){e.toString();e.printStackTrace();}}private void deleteM(HttpServletRequest request, HttpServletResponse response){//车辆删除ResultSet lst=null;cheliangDao dao = new cheliangDao();response.setCharacterEncoding("gb2312");String keyid=(String)request.getParameter("keyid"); try{dao.delete(keyid);request.setAttribute("flag", "删除成功"); request.getRequestDispatcher("cheliangServlet?method=list").forward(request, response);//response.sendRedirect("cheliangServlet?method=list");}catch(Exception e){e.toString();e.printStackTrace();}}
三、注意事项
1、管理员账号:admin密码:admin 数据库配置文件DBO.java
2、开发环境为TOMCAT9.0,idea2019.3 jdk1.8开发,数据库为sqlserver2008或者以上版本,使用java语言开发。
3、数据库文件名是jspcarlend.mdf,系统名称carlend
4、地址:login.jsp
四系统实现
代码下载
https://download.csdn.net/download/qq_41221322/89087552
需要源码 其他的定制服务 下方联系卡片↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓