java intelligent parking lot management system, source code, help run (jsp+servlet+jdbc+mysql Implementation), can be used as course assignments, final projects, etc., without using the framework


java intelligent parking lot management system, source code, help run (jsp+servlet+jdbc+mysql Implementation), can be used as course assignments, final projects, etc., without using the framework

Implementation technology introduction

The java intelligent parking lot management system is implemented by javaee, and the database is implemented by mysql. There is no framework. The front end is normal html, CSS and JS. The implementation is relatively simple, and the content is some common functions

directory structure

  1. Java code section
    There are three packages, the first is the basic class, model, the second is the implementation of jdbc, and the third is the implementation of servlet
  2. jsp part
    The jsp part is mainly about some front-end display and operation. The content is not complex and easy to understand

Main page and its implementation code

  1. landing
    The login function is simple. The account is stored in clear text without encryption. Query whether the account exists in the database. If it does not exist, return blank
public boolean checkLogin(String user_id,String user_pwd)
	{
		String sqlCmd="select count(*) from user where user_id=? and user_pwd=?";//Query T-SQL command to execute
		Object[] objList=new Object[2];//An array of objects, used as an array of objects? Container for parameters
		objList[0]=user_id;
		objList[1]=user_pwd;
		String result=SQLUtil.excuteScalar(sqlCmd,objList).toString();//Execute query with parameters
		if(result.equals("1"))
		{
			return true;
		}
		else {
			return false;
		}
	}
	
  1. Specific function examples. For example, obtain the information of vehicles not leaving the parking lot
private void getNoOut() throws ServletException, IOException
			{
				request.setCharacterEncoding("UTF-8");
				int page=request.getParameter("page")==null?1:Integer.parseInt(request.getParameter("page").toString());//Get page number of jump
				int totalPage=Integer.parseInt(fixed.getPageCount().toString()) ;//Get total number of pages
				List<Object> list=fixed.getNoOut(page);//Get data list
				request.setAttribute("list",list);//Store the data in the request object for forwarding to the foreground page for use
				request.setAttribute("totalPage",totalPage );//Store totalPage in the request object for forwarding to the foreground page for use
				request.getRequestDispatcher("/Admin/FixedOut.jsp").forward(request, response);//Request forwarding
			}

3.jsp page example, such as login page

 <form action="<%=path %>/LoginHandle" method="post" id="loginForm">
			<div class='login_fields__user' style="margin-top:10px;margin-bottom:10px;width:70%;margin-left:15%;border-bottom:1px solid rgba(255,255,255,0.5);">
				<div class='icon'>
					<img alt="" src='images/user_icon_copy.png'>
				</div>
				<input id="username" name="user_id" placeholder='user name' maxlength="16" type='text' autocomplete="off" value="SAdmin"/>
			</div>
			<div class='login_fields__password' style="margin-bottom:10px;width:70%;margin-left:15%;border-bottom:1px solid rgba(255,255,255,0.5);">
				<div class='icon'>
					<img alt="" src='images/lock_icon_copy.png'>
				</div>
				<input id="password" name=user_pwd type="password" placeholder='password' value="123123" maxlength="16" type='text' autocomplete="off">
			</div>
			<div class='login_fields__submit'>
				<input type='submit' value='Login' id="login">
			</div>
			</form>
  1. Demo example
    Query relevant information of parking lot system users

    Manage parking space information

    Manage the parking lot user information

    The main menu of java parking lot system contains some of its functions, such as adding parking space information, managing parking space information, managing user information, etc

MySQL database structure

There are six tables in total. The function of the table is the same as the name Description

sql code example

CREATE TABLE `card` (
  `card_id` varchar(50) NOT NULL,
  `seat_id` varchar(50) NOT NULL,
  `user_name` varchar(50) NOT NULL,
  `user_gender` varchar(1) NOT NULL,
  `user_addr` varchar(50) NOT NULL,
  `car_num` varchar(50) NOT NULL,
  PRIMARY KEY (`card_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `card` */
CREATE TABLE `fixed` (
  `fixed_id` varchar(50) NOT NULL,
  `card_id` varchar(50) NOT NULL,
  `entry_date` date NOT NULL,
  `entry_time` time NOT NULL,
  `out_date` date DEFAULT NULL,
  `out_time` time DEFAULT NULL,
  PRIMARY KEY (`fixed_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Download address

See the website for specific download information of the project: http://yanzw.cn/post/27
Or click here to jump
Or contact the author of this article directly. For contact information, see: http://yanzw.cn/post/18
Or click here to jump to my blog
Click here to jump to the blog home page

Statement: if there is infringement in this article, please contact us to delete it

Tags: Database MySQL Java servlet JSP

Posted by hip_hop_x on Mon, 30 May 2022 12:59:37 +0530