You are on page 1of 29

INTRODUCTION

The project, Hotel Management System is a web-based application that


allows the hotel manager to handle all hotel activities online. Interactive
GUI and the ability to manage various hotel bookings and rooms make
this system very flexible and convenient. The hotel manager is a very
busy person and does not have the time to sit and manage the entire
activities manually on paper. This application gives him the power and
flexibility to manage the entire system from a single online system. Hotel
management project provides room bookings, staff management and
other necessary hotel management features. The system allows the
manager to post available rooms in the system. Customers can view and
book room online. Admin has the power of either approving or
disapproving the customer’s booking request. Other hotel services can
also be viewed by the customers and can book them too. The system is
hence helpful for both customers and managers to portably manage the
hotel activities.

1
Problem definition
EXISTING SYSTEM:-
The first problem is that there are lots of hard copy
documents being generated. This brings us to the age old
discussion of keeping information in the form databases
versus keeping the same on sheets of paper. Keeping the
information in the form of hard copied documents leads to
the following problems.Choosing the right Text Editor was so
difficult so that we can write the codes essily in less time.

DRAWBACKS OF EXISTING SYSTEM:-


Lack of space:- It becomes a problem in itself to find
space to keep the sheets of paper being generated as
a result of the ongoing discussion. The documents
being generated are too important to be ill treated.
Filing poses a problem:- Filing the documents
categorically is a time consuming and tedious exercise.
Filtering is not easy:- It becomes hard to filter
relevant documents for the irrelevant ones if the count
of the same crosses a certain manageable number.
Reviewing becomes time-consuming:-All the process
done manually at the centers and all the records are
maintained on the papers. So the maintenance of the
record is very difficult in the departments and as well
as it’s very difficult for the workers to check the
record. The Existing system is paper based, time
consuming, monotonous, less flexible and provides a
very hectic working schedule. The chance of loss of
records is high and also record is high and also record
2
searching is difficult. Maintenance of the system is
also very difficult and takes lot of time.
Result processing:- It is slow due to paper work and
requirement of staff.

3
PROPOSED SYSTEM
This Software provides the informations of New technologies
of the world wide. It saves time as it allows numbers of
students to give the exam at a time and displays the results
as the test gets over, so no need to wait for the result. It is
automatically generated by the server. Administrator has a
privilege to create, modify and delete the test papers and its
particular questions.

User can register, login and give the test with his specific id,
and can see the results as well.

4
System Required for this Application:-
Software requirement-

 Operating System: Vista, Windows XP, 7 and above.


 Netbeans
 MySQL

Hardware requirement-
 Processor: Pentium core & above
 Physical memory: 2GB Ram &above.
 Monitor

Front End Tool

 Netbeans

Back End Tool

 Mysql

Programming Language

 Java

5
java
Java is a general-purpose computer programming language that is
concurrent, class-based, object-oriented, and specifically designed to
have as few implementation dependencies as possible. It is intended
to let application developers “ write once, run anywhere “(WORA),
meaning that complied Java code can run on all platforms that
support Java without the need for recompilation. Java a applications
are typically compiled to bytecode that can run on any Java Virtual
Machine (JVM) regardless of computer architecture. As of 2016, Java
is one of the most popular programming languages in use,
particularly for vlient-server web applications, with a reported 9
million developers. Java was originally developed by James Gosling at
Sun Microsystems (which has since been acquired by Oracle
Corporation) and released in 1995 as a core component of Sun
Microsystems Java platform. The language derives much of its syntax
from C and C++, but it has fewer low level facilities than either of
them.

The original and reference implementation Java compilers, virtual


machines, and class libraries were originally released by Sun under
proprietary licenses. As of May 2007, in compliance with the
specifications of the Java Community Process, Sun reticence most of
its Java technologies under theGNU General Public License. Others
have also developed alternative implementations of these Sun
technologies, such as the GNU Compiler for Java (bytecode compiler),
GNU Classpath (standard libraries), and IcedTea-Web (browser plug-
in for applets).

6
Principles
There were five primary goals in the creation of the Java language:

1. It must be “simple, object-oriented, and familiar “.


2. It must be “ robust and secure “.
3. It must be “ architecture-neutral and portable “.
4. It must execute with “ high performance “.
5. It must be “ interpreted, threaded, and dynamic “.

7
mysql
MySQL is a database system used for developing web-based
software applications. It is a relational database management
system It is fast, reliable, and flexible and easy to use. It
supports standard SQL .It is free to download and use. It was
developed by Michael Widenius and David Axmark in 1994. It is
presently developed, distributed, and supported by Oracle
Corporation. It is the world's most popular open source
database. With its proven performance, reliability and ease-of-
use, MySQL has become the leading database choice for web-
based applications.

SQL is a language that is used to manage data stored in a


RDBMS. It comprises of a Data Definition Language (DDL) and a
Data Manipulation Language (DML) where DDL is a language
which is used to define structure and constraints of data and
DML is used to insert, modify and delete data in a database.

8
Mysql Syntax
CREATE TABLE customers(customer_id int NOT
NULL,customer_name char(50) NOT NULL,address
char(50),Room_no int,Email_ID varchar(50),Check_In_Date
date,Mobile_Number varchar(20),PRIMARY KEY
(customer_id));

mysql> Create table room(Room_no int,Status varchar(20));

9
Netbeans
NetBeans is an integrated development environment (IDE) for
Java. NetBeans runs on Windows, macOS, Linux etc.NetBeans is
created for developers who want to build applications in a fast
and smart way by providing rich code analyzers, editors, and
converters that support the latest Java technologies. It enables
developers to take advantage of the advanced Java 8(and
above) language constructs to quickly and easily upgrade
applications.The system will also run smoothly on any
operating platform without the need to adjust any of the users’
coding scheme. It also provides a vast number of editing tools
which can work on different languages such as JavaScript, XML,
and HTML.

The system’s code editor empowers users to proceed with their


coding quickly and smoothly by offering them with robust tools,
code generators, code templates and coding tips for easy
refactoring. The system’s functionalities can be extended
through various plugins and the editor works well with drag
and drop tools.NetBeans has static analysis tools which enable
users to save expenses gained from buggy code. There is also a
NetBeans Profiler feature that could provide professional
assistance to developers and aid them in optimizing application
speed and memory usage.

10
interfaces
Home Page

CODE
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
setVisible(false);
LoginForm l= new LoginForm();
l.setVisible(true);

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


setVisible(false);
SignupForm l= new SignupForm();
l.setVisible(true);

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {


System.exit(1);
}

11
Login page

CODE
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try
{

String
dbURL="jdbc:mysql://localhost:3306/xxxx?zeroDateTimeBehavior=CONVERT_T
O_NULL";
Connection
dbcon=java.sql.DriverManager.getConnection(dbURL,"root","aniket@12");
Statement stmt=dbcon.createStatement();
String query="Select * from login";
ResultSet rs=stmt.executeQuery(query);
System.out.println(query);
int c=0;
while(rs.next())
{
String uval=rs.getString(1);
String pwdval=rs.getString(2);
if(user.getText().equals(uval) && pass.getText().equals(pwdval))

12
{
c++;
JOptionPane.showMessageDialog(null, "Login Sucessful");
setVisible(false);
Menu d=new Menu();
d.setVisible(true);
break;
}
}
if(c==0)
{
JOptionPane.showMessageDialog(null, "Wrong Username or
Password");

}
}
catch(SQLException e)
{
System.out.print(e.getMessage());
}
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


System.exit(1);
}
private void jLabel5MouseClicked(java.awt.event.MouseEvent evt) {
setVisible(false);
SignupForm s=new SignupForm();
s.setVisible(true);

}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
setVisible(false);
Home l= new Home();
l.setVisible(true);
}

13
Signup Form

CODE
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try
{

String
dbURL="jdbc:mysql://localhost:3306/xxxx?zeroDateTimeBehavior=CONVERT_
TO_NULL";
Connection
dbCon=java.sql.DriverManager.getConnection(dbURL,"root","aniket@12");
String query= "insert into login values
('"+Uname.getText()+"','"+pass.getText()+"')";
System.out.println(query);
PreparedStatement pstmt=dbCon.prepareStatement(query);
pstmt.executeUpdate(query);
JOptionPane.showMessageDialog(null, "Account Created");
setVisible(false);
LoginForm L1=new LoginForm();
L1.setVisible(true);

}
catch(SQLException e)
{
JOptionPane.showMessageDialog(null,"Username already Exists");
14
}
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


System.exit(1);
}

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {


setVisible(false);
LoginForm l1=new LoginForm();
l1.setVisible(true);
}

15
Home

CODE
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
setVisible(false);
Coustomer_Information s=new Coustomer_Information();
s.setVisible(true);
}

private void faculty_informationActionPerformed(java.awt.event.ActionEvent evt) {


setVisible(false);
Coustomers_Details f=new Coustomers_Details();
f.setVisible(true);

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


setVisible(false);
LoginForm L1=new LoginForm();
L1.setVisible(true);
}

16
Customer Information

CODE

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

try

String
dbURL="jdbc:mysql://localhost:3306/xxxx?zeroDateTimeBehavior=CONVERT_TO_N
ULL";

Connection
dbCon=java.sql.DriverManager.getConnection(dbURL,"root","aniket@12");

String query= "insert into


customer_Information(customer_id,customer_name,address,Mobile_Number,Email
_ID) values "

+ "('"+id.getText()+"','"+name.getText()+"','"+address.getText()+

17
"','"+city.getText()+"','"+EID.getText()+"')";

System.out.println(query);

PreparedStatement pstmt=dbCon.prepareStatement(query);

pstmt.executeUpdate(query);

JOptionPane.showMessageDialog(null, "Information Saved");

catch(SQLException e)

System.out.print(e.getMessage());

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {

setVisible(false);

allot_room s=new allot_room();

s.setVisible(true);

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {

setVisible(false);
18
Menu d=new Menu();

d.setVisible(true);

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {

id.setText("");

name.setText("");

address.setText("");

city.setText("");

EID.setText("");

19
Room

CODE
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try
{
String
dbURL="jdbc:mysql://localhost:3306/xxxx?zeroDateTimeBehavior=CONVERT_TO_NULL";
Connection
dbCon=java.sql.DriverManager.getConnection(dbURL,"root","aniket@12");
Statement stmt=dbCon.createStatement();
String query= "Update customer_Information set Room_no=
"+roomNo.getText()+" where customer_id = '"+CID.getText()+"';";
String query2= "Update customer_Information set Check_In_Date=
'"+in.getText()+"' where customer_id = '"+CID.getText()+"';";
String qurey1="Insert Into room values ("+roomNo.getText()+",'Not Available');";
System.out.println(query);
System.out.println(qurey1);
stmt.executeUpdate(query);
stmt.executeUpdate(qurey1);
JOptionPane.showMessageDialog(null, "Room Booked");
}
catch(SQLException e)
{
JOptionPane.showMessageDialog(null, "Room already Booked/Not available");
}
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


setVisible(false);
Coustomer_Information d=new Coustomer_Information();
d.setVisible(true);
}
20
View Information

CODE
public void showRecords()
{
try
{
String
dbURL="jdbc:mysql://localhost:3306/xxxx?zeroDateTimeBehavior=CONVERT_TO_NULL
";
Connection
dbCon=java.sql.DriverManager.getConnection(dbURL,"root","aniket@12");
Statement stmt=dbCon.createStatement();
String query= "Select * from customer_Information";
System.out.println(query);
ResultSet rs=stmt.executeQuery(query);
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null, e.getMessage());
}
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
21
showRecords();
}

private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {


try
{
String
dbURL="jdbc:mysql://localhost:3306/xxxx?zeroDateTimeBehavior=CONVERT_TO_NULL
";
Connection
dbCon=java.sql.DriverManager.getConnection(dbURL,"root","aniket@12");
Statement stmt=dbCon.createStatement();
String query= "Select * from room";
System.out.println(query);
ResultSet rs=stmt.executeQuery(query);
room.setModel(DbUtils.resultSetToTableModel(rs));
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null, e.getMessage());
}
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


try
{
String
dbURL="jdbc:mysql://localhost:3306/xxxx?zeroDateTimeBehavior=CONVERT_TO_NULL
";
Connection
dbCon=java.sql.DriverManager.getConnection(dbURL,"root","aniket@12");
Statement stmt=dbCon.createStatement();
String query= "Select * from customer_Information where
customer_id='"+CIID.getText()+"';";
System.out.println(query);
ResultSet rs=stmt.executeQuery(query);
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null, e.getMessage());
}
}

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {


try
{

22
String
dbURL="jdbc:mysql://localhost:3306/xxxx?zeroDateTimeBehavior=CONVERT_TO_NULL
";
Connection
dbCon=java.sql.DriverManager.getConnection(dbURL,"root","aniket@12");
Statement stmt=dbCon.createStatement();
String query= "Select * from room where Room_no="+Rnum.getText()+";";
System.out.println(query);
ResultSet rs=stmt.executeQuery(query);
room.setModel(DbUtils.resultSetToTableModel(rs));
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null, e.getMessage());
}
}

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {


setVisible(false);
Update_Information n=new Update_Information();
n.setVisible(true);
}

private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {


setVisible(false);
Menu m=new Menu();
m.setVisible(true);
}

23
Update Information

CODE
public void showRecords()

try

String
dbURL="jdbc:mysql://localhost:3306/xxxx?zeroDateTimeBehavior=CONVERT_TO_NULL";

Connection
dbCon=java.sql.DriverManager.getConnection(dbURL,"root","aniket@12");

Statement stmt=dbCon.createStatement();

String query= "Select * from customer_Information";

System.out.println(query);

ResultSet rs=stmt.executeQuery(query);

24
jTable1.setModel(DbUtils.resultSetToTableModel(rs));

catch(Exception e)

JOptionPane.showMessageDialog(null, e.getMessage());

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {

showRecords();

private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {

try

String
dbURL="jdbc:mysql://localhost:3306/xxxx?zeroDateTimeBehavior=CONVERT_TO_NULL";

Connection
dbCon=java.sql.DriverManager.getConnection(dbURL,"root","aniket@12");

Statement stmt=dbCon.createStatement();

String query= "Select * from room";

System.out.println(query);

ResultSet rs=stmt.executeQuery(query);

room.setModel(DbUtils.resultSetToTableModel(rs));

catch(Exception e)

JOptionPane.showMessageDialog(null, e.getMessage());

25
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

try

String
dbURL="jdbc:mysql://localhost:3306/xxxx?zeroDateTimeBehavior=CONVERT_TO_NULL";

Connection
dbCon=java.sql.DriverManager.getConnection(dbURL,"root","aniket@12");

Statement stmt=dbCon.createStatement();

String query= "Select * from customer_Information where


customer_id='"+CIID.getText()+"';";

System.out.println(query);

ResultSet rs=stmt.executeQuery(query);

jTable1.setModel(DbUtils.resultSetToTableModel(rs));

catch(Exception e)

JOptionPane.showMessageDialog(null, e.getMessage());

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {

try

String
dbURL="jdbc:mysql://localhost:3306/xxxx?zeroDateTimeBehavior=CONVERT_TO_NULL";

26
Connection
dbCon=java.sql.DriverManager.getConnection(dbURL,"root","aniket@12");

Statement stmt=dbCon.createStatement();

String query= "Select * from room where Room_no="+Rnum.getText()+";";

System.out.println(query);

ResultSet rs=stmt.executeQuery(query);

room.setModel(DbUtils.resultSetToTableModel(rs));

catch(Exception e)

JOptionPane.showMessageDialog(null, e.getMessage());

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {

setVisible(false);

Update_Information n=new Update_Information();

n.setVisible(true);

private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {

setVisible(false);

Menu m=new Menu();

m.setVisible(true);

27
CONCLUSION
The conclusion of this project is, A Hotel management
system is a computerized management system. This
system keeps the records of Customers and rooms of a
organization. The proposed system will keep a track of
customer Information and room status. This project has
GUI based software that will help in storing, updating
and retrieving the information. The project “Hotel
Management System” is aimed to develop to maintain
the day-to-day state of check in of customers,etc. Main
objective of this project is to provide solution for hotel
to manage most there work using computerized process.
This software application will help to handle customers
information, room allocation details. The existing
system is a manually maintained system. All the details
are entered and retrieved manually, because of this
there are many disadvantages like Time Consuming,
updating process, inaccuracy of data. For avoiding this
we introduced or proposed a new system in proposed
system the computerized version of the existing system
provides easy and quick access over the data .

28
BIBLIOGRAPHY
 Information Technology Class XII(Book)
 Internet
 https://www.java.com
 https://www.mysql.com
 https://netbeans.apache.org
 https://www.wikipedia.org
 https://www.w3schools.com

29

You might also like