Professional Documents
Culture Documents
BY
RAHUAL S (212000752)
TO
APRIL - 2023
CERTIFICATE
has not formed the basis of award of any Degree, Diploma, Fellowship, or other
similar titles.
Place: Chennai
Date:
SANU MANOJ
(212000730)
NIRMAL KUMAR M
(212004722)
Forwarded by
(Mrs. K ABIRAMI.MCA,MPhill,SET)
Signature of Guide
ACKNOWLEDGEMENT
We would take this opportunity to express our greatest regards first to our guide Mrs K
and support, which have been instrumental in accomplishing this project work.
We would also like to thank our H.O.D Dr R M .CHAMUNDESHWARI, and department staff
At last we would like to thank our entire respondents and others who helped us directly or
Place: Chennai
Date:
RAHUAL S
SANU MANOJ
NIRMAL KUMAR M
TABLE OF CONTENTS
1 ABSTRACT 7
2 INTRODUCTION 8
5 FUTURE ENHANCHEMENT 10
6 DATAFLOW DIAGRAM 11
CLASS MODULES
8 CONCLUSION 88
9 REFERENCE 88
1. ABSTRACT
Hotel management using Eclipse and MySQL typically involves developing a software system that can
perform tasks related to hotel management, such as managing reservations, room allocation, billing, guest
information, and other related tasks. Eclipse is a popular Integrated Development Environment (IDE) that
can be used to develop the software, while MySQL is a widely-used open-source relational database
management system that can store and manage data used by the software.
Developing such a system typically involves designing a database schema to represent the data used by the
system, creating user interfaces to allow users to interact with the system, and writing code to handle
business logic and manage the data. Eclipse can provide tools for writing and debugging the code, while
MySQL can provide tools for managing the database and querying data.
Overall, hotel management using Eclipse and MySQL involves combining software development skills with
an understanding of hotel management operations to create a system that can efficiently manage hotel
operations and improve guest experience.
2. INTRODUCTION
The Hotel Management tool is a versatile and user-friendly software solution designed to streamline a range
of activities associated with managing a hotel. With this tool, hotel staff can easily store and access customer
details, including contact information, booking history, and special requests or preferences. The software
also offers a comprehensive booking system, which allows staff to easily manage room bookings of various
types, including single, double, deluxe, and executive suites. In addition, the software includes a convenient
food ordering feature, enabling guests to order room service directly from their rooms, with staff able to
easily track and manage food orders and delivery. Should the need arise, staff can also quickly and easily
unbook rooms and cancel reservations, with the software automatically updating availability and billing
accordingly. Finally, the Hotel Management tool includes a robust billing and invoicing system, which
provides guests with accurate and transparent billing information, while also enabling staff to efficiently
manage payments and generate invoices as needed. Overall, the Hotel Management tool is an invaluable
resource for any hotel looking to improve its operations and enhance the guest experience.
This system may include features such as room booking and reservation management, customer
relationship management, inventory and supply management, and financial management
The proposed system is designed to provide secure access to authorized personnel only. This is
achieved by implementing a user authentication system that requires a valid username and password
to access the system. Specifically, the proposed system can be accessed only by the admin, who is
responsible for managing the system and ensuring its security.
To access the system, the admin will be required to enter their unique username and password, which
will be verified by the system's authentication server. Once the admin has successfully authenticated,
they will be granted access to the system's dashboard, which will provide a range of tools and
features to manage the system's functionality.
3.4 ADVANTAGE OF PROPOSED SYSTEM
Enhanced Security: The proposed system's user authentication system provides a higher level of
security compared to systems that do not require authentication
Access Control: The user authentication system provides access control, allowing the admin to grant
and revoke access to the system's features and functions as necessary.
Accountability: The user authentication system provides a way to track user activity and actions
within the system, providing accountability for actions taken by authorized personal
Convenience: The user authentication system can be convenient for the admin, as they only need to
remember one set of login credentials to access the system.
Mobile Application: Develop a mobile application that can integrate with the hotel management system. This can
provide guests with a user-friendly interface for making reservations, checking in/out, and accessing other hotel
services.
AI Chatbot: Implement an AI-powered chatbot that can assist guests with common requests, such as room service,
housekeeping, or local recommendations.
IoT Integration: Integrate IoT devices, such as smart locks, thermostats, and lighting systems, with the hotel
management system. This can enable hotel staff to remotely control room settings and provide guests with a more
personalized experience.
Predictive Analytics: Use predictive analytics to identify patterns and trends in guest behavior and preferences. This
can help hotel staff anticipate guest needs and provide tailored recommendations for services and amenities.
Blockchain Technology: Implement blockchain technology to improve data security and transparency. This can help
prevent fraud and ensure that guest data is kept private and secure.
6,DATA FLOW DIAGRAM:
LOGIN
Dashboard
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
JLabel l1;
JButton b1;
public HotelManagementSystem() {
setSize(1400,800);
setLayout(null);
setVisible(true);
l1 = new JLabel("");
b1 = new JButton("Next");
b1.setBackground(Color.WHITE);
b1.setForeground(Color.BLACK);
ImageIcon i1 = new ImageIcon("C:/Rahual\\ho1.png");
l1.setBounds(10,10,1366,390);
lid.setBounds(30,300,1500,100);
lid.setFont(new Font("serif",Font.PLAIN,70));
lid.setForeground(Color.red);
l1.add(lid);
b1.setBounds(1170,325,150,50);
l1.add(b1);
add(l1);
b1.addActionListener(this);
setVisible(true);
while(true){
try{
}catch(Exception e){}
lid.setVisible(true);
try{
Thread.sleep(500);
}catch(Exception e){}
new Login().setVisible(true);
this.setVisible(false);
window.setVisible(true);
SCREENSHOT:
7.2 LOGIN:
package hotel.management.system;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
JLabel l1,l2;
JTextField t1;
JPasswordField t2;
JButton b1,b2;
Login(){
super("Login");
setLayout(null);
l1 = new JLabel("Username");
l1.setBounds(40,20,100,30);
add(l1);
l2 = new JLabel("Password");
l2.setBounds(40,70,100,30);
add(l2);
t1=new JTextField();
t1.setBounds(150,20,150,30);
add(t1);
t2=new JPasswordField();
t2.setBounds(150,70,150,30);
add(t2);
ImageIcon(ClassLoader.getSystemResource("hotel/management/system/icons/second.jpg"));
//Image i2 = i1.getImage().getScaledInstance(200,200,Image.SCALE_DEFAULT);
//l3.setBounds(350,10,150,150);
// add(l3);
b1 = new JButton("Login");
b1.setBounds(40,140,120,30);
b1.setFont(new Font("serif",Font.BOLD,15));
b1.addActionListener(this);
b1.setBackground(Color.BLACK);
b1.setForeground(Color.WHITE);
add(b1);
b2=new JButton("Cancel");
b2.setBounds(180,140,120,30);
b2.setFont(new Font("serif",Font.BOLD,15));
b2.setBackground(Color.BLACK);
b2.setForeground(Color.WHITE);
add(b2);
b2.addActionListener(this);
getContentPane().setBackground(Color.WHITE);
setVisible(true);
setSize(600,300);
setLocation(600,350);
if(ae.getSource()==b1){
try{
String u = t1.getText();
String v = t2.getText();
ResultSet rs = c1.s.executeQuery(q);
if(rs.next()){
new Dashboard().setVisible(true);
setVisible(false);
}else{
setVisible(false);
}catch(Exception e){
e.printStackTrace();
}else if(ae.getSource()==b2){
System.exit(0);
SCREENSHOT
7.3 DASHBOARD:
package hotel.management.system;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
new Dashboard().setVisible(true);
public Dashboard() {
setForeground(Color.CYAN);
setLayout(null);
// ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("hotel/management/system/icons/third.jpg"));
AirlineManagementSystem.setForeground(Color.WHITE);
//NewLabel.add(AirlineManagementSystem);
setJMenuBar(menuBar);
AirlineSystem.setForeground(Color.BLUE);
menuBar.add(AirlineSystem);
AirlineSystem.add(FlightDetails);
JMenu AirlineSystemHello = new JMenu("ADMIN");
AirlineSystemHello.setForeground(Color.RED);
menuBar.add(AirlineSystemHello);
AirlineSystemHello.add(FlightDetailshello1);
FlightDetailshello1.addActionListener(new ActionListener(){
try{
new AddEmployee().setVisible(true);
}catch(Exception e ){}
});
AirlineSystemHello.add(FlightDetailshello2);
FlightDetailshello2.addActionListener(new ActionListener(){
try{
new AddRoom().setVisible(true);
}catch(Exception e ){}
});
FlightDetails.addActionListener(new ActionListener(){
new Reception();
});
AirlineSystemHello.add(FlightDetailshello3);
FlightDetailshello3.addActionListener(new ActionListener(){
new AddDrivers().setVisible(true);
}catch(Exception e ){}
});
setSize(1950,1090);
setVisible(true);
getContentPane().setBackground(Color.WHITE);
SCREENSHOT:
7.4 RECEPTION:
package hotel.management.system;
import javax.swing.*;
import java.sql.*;
import java.awt.event.*;
import java.awt.*;
public class Reception extends JFrame {
new Reception();
public Reception(){
setContentPane(contentPane);
contentPane.setLayout(null);
//ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("hotel/management/system/icons/fourth.jpg"));
// l1.setBounds(250,30,500,470);
// add(l1);
btnNewCustomerForm.addActionListener(new ActionListener() {
try{
custom.setVisible(true);
setVisible(false);
}catch(Exception e1){
e1.printStackTrace();
});
btnNewCustomerForm.setForeground(Color.WHITE);
contentPane.add(btnNewCustomerForm);
btnNewButton.addActionListener(new ActionListener() {
try{
room.setVisible(true);
setVisible(false);
catch(Exception e){
e.printStackTrace();
});
btnNewButton.setBackground(Color.BLACK);
btnNewButton.setForeground(Color.WHITE);
contentPane.add(btnNewButton);
btnNewButton_1.addActionListener(new ActionListener() {
try{
dept.setVisible(true);
setVisible(false);
}
catch (Exception e1){
e1.printStackTrace();
});
btnNewButton_1.setBackground(Color.BLACK);
btnNewButton_1.setForeground(Color.WHITE);
contentPane.add(btnNewButton_1);
btnNewButton_2.addActionListener(new ActionListener() {
try{
em.setVisible(true);
setVisible(false);
e1.printStackTrace();
});
btnNewButton_2.setBackground(Color.BLACK);
btnNewButton_2.setForeground(Color.WHITE);
contentPane.add(btnNewButton_2);
btnNewButton_3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try{
//error ---------------------
customer.setVisible(true);
setVisible(false);
e1.printStackTrace();
});
btnNewButton_3.setBackground(Color.BLACK);
btnNewButton_3.setForeground(Color.WHITE);
contentPane.add(btnNewButton_3);
btnManagerInfo.addActionListener(new ActionListener() {
try{
mana.setVisible(true);
setVisible(false);
e1.printStackTrace();
});
btnManagerInfo.setBounds(10, 230, 200, 30);
btnManagerInfo.setBackground(Color.BLACK);
btnManagerInfo.setForeground(Color.WHITE);
contentPane.add(btnManagerInfo);
btnNewButton_4.addActionListener(new ActionListener() {
CheckOut check;
try {
check.setVisible(true);
setVisible(false);
e1.printStackTrace();
});
btnNewButton_4.setBackground(Color.BLACK);
btnNewButton_4.setForeground(Color.WHITE);
contentPane.add(btnNewButton_4);
btnNewButton_5.addActionListener(new ActionListener() {
try{
setVisible(false);
catch(Exception e1){
e1.printStackTrace();
});
btnNewButton_5.setBackground(Color.BLACK);
btnNewButton_5.setForeground(Color.WHITE);
contentPane.add(btnNewButton_5);
btnNewButton_6.addActionListener(new ActionListener() {
try{
room.setVisible(true);
setVisible(false);
}catch(Exception s)
s.printStackTrace();
});
btnNewButton_6.setBackground(Color.BLACK);
btnNewButton_6.setForeground(Color.WHITE);
contentPane.add(btnNewButton_6);
JButton btnPickUpSerice = new JButton("Pick up Service");
btnPickUpSerice.addActionListener(new ActionListener() {
try{
pick.setVisible(true);
setVisible(false);
catch(Exception e){
e.printStackTrace();
});
btnPickUpSerice.setBackground(Color.BLACK);
btnPickUpSerice.setForeground(Color.WHITE);
contentPane.add(btnPickUpSerice);
btnSearchRoom.addActionListener(new ActionListener() {
try {
search.setVisible(true);
setVisible(false);
ss.printStackTrace();
}
});
btnSearchRoom.setBackground(Color.BLACK);
btnSearchRoom.setForeground(Color.WHITE);
contentPane.add(btnSearchRoom);
btnNewButton_7.addActionListener(new ActionListener() {
try {
new Login().setVisible(true);
setVisible(false);
} catch (Exception e) {
e.printStackTrace();
});
btnNewButton_7.setBackground(Color.BLACK);
btnNewButton_7.setForeground(Color.WHITE);
contentPane.add(btnNewButton_7);
getContentPane().setBackground(Color.WHITE);
setVisible(true);
}
SCREENSHOT:
.BorderLayout;
import java.awt.*;
import java.awt.EventQueue;
import javax.swing.border.EmptyBorder;
import java.awt.Font;
import java.awt.Image;
import java.sql.*;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
JComboBox comboBox;
JRadioButton r1,r2;
Choice c1;
/**
*/
EventQueue.invokeLater(new Runnable() {
try {
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
});
setContentPane(contentPane);
contentPane.setLayout(null);
//ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("hotel/management/system/icons/fifth.png"));
contentPane.add(lblName);
contentPane.add(lblId);
comboBox = new JComboBox(new String[] {"Passport", "Aadhar Card", "Voter Id", "Driving license"});
contentPane.add(comboBox);
contentPane.add(l2);
t1 = new JTextField();
contentPane.add(t1);
t1.setColumns(10);
contentPane.add(lblName_1);
t2 = new JTextField();
contentPane.add(t2);
t2.setColumns(10);
JLabel lblGender = new JLabel("Gender :");
contentPane.add(lblGender);
r1 = new JRadioButton("Male");
r1.setBackground(Color.WHITE);
add(r1);
r2 = new JRadioButton("Female");
r2.setBackground(Color.WHITE);
add(r2);
contentPane.add(lblCountry);
contentPane.add(lblReserveRoomNumber);
c1 = new Choice();
try{
while(rs.next()){
c1.add(rs.getString("room_number"));
}catch(Exception e){ }
c1.setBounds(271, 274, 150, 20);
contentPane.add(c1);
contentPane.add(lblCheckInStatus);
contentPane.add(lblDeposite);
t3 = new JTextField();
contentPane.add(t3);
t3.setColumns(10);
t5 = new JTextField();
contentPane.add(t5);
t5.setColumns(10);
t6 = new JTextField();
contentPane.add(t6);
t6.setColumns(10);
btnNewButton.addActionListener(new ActionListener() {
if(r1.isSelected()){
radio = "Male";
}
else if(r2.isSelected()){
radio = "Female";
String s6 = c1.getSelectedItem();
try{
String s1 = (String)comboBox.getSelectedItem();
String s2 = t1.getText();
String s3 = t2.getText();
String s4 = radio;
String s5 = t3.getText();
String s7 = t5.getText();
String s8 = t6.getText();
c.s.executeUpdate(q1);
c.s.executeUpdate(q2);
new Reception().setVisible(true);
setVisible(false);
}catch(SQLException e1){
System.out.println(e1.getMessage());
catch(NumberFormatException s){
});
btnNewButton.setForeground(Color.WHITE);
contentPane.add(btnNewButton);
btnExit.addActionListener(new ActionListener() {
new Reception().setVisible(true);
setVisible(false);
});
btnExit.setBackground(Color.BLACK);
btnExit.setForeground(Color.WHITE);
contentPane.add(btnExit);
getContentPane().setBackground(Color.WHITE);
SCREENSHOT:
7.6 Room:
package hotel.management.system;
import java.awt.BorderLayout;
import java.awt.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import net.proteanit.sql.DbUtils;
import javax.swing.JTable;
import java.sql.*;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
/**
*/
EventQueue.invokeLater(new Runnable() {
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
});
//conn = Javaconnect.getDBConnection();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setContentPane(contentPane);
contentPane.setLayout(null);
ImageIcon(ClassLoader.getSystemResource("hotel/management/system/icons/eight.jpg"));
contentPane.add(table);
btnLoadData.addActionListener(new ActionListener() {
try{
table.setModel(DbUtils.resultSetToTableModel(rs));
}
catch(Exception e1){
e1.printStackTrace();
});
btnLoadData.setBackground(Color.BLACK);
btnLoadData.setForeground(Color.WHITE);
contentPane.add(btnLoadData);
btnNewButton.addActionListener(new ActionListener() {
new Reception().setVisible(true);
setVisible(false);
});
btnNewButton.setBackground(Color.BLACK);
btnNewButton.setForeground(Color.WHITE);
contentPane.add(btnNewButton);
contentPane.add(lblAvailability);
contentPane.add(lblCleanStatus);
contentPane.add(lblNewLabel);
contentPane.add(lblId);
getContentPane().setBackground(Color.WHITE);
SCREENSHOT:
7.7 Department:
package hotel.management.system;
import java.awt.BorderLayout;
import java.awt.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
mport net.proteanit.sql.DbUtils;
mport javax.swing.JTable;
import java.sql.*;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
/**
*/
EventQueue.invokeLater(new Runnable() {
try {
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
});
this.dispose();
/**
* Create the frame.
* @throws SQLException
*/
//conn = Javaconnect.getDBConnection();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setContentPane(contentPane);
contentPane.setLayout(null);
contentPane.add(table);
btnNewButton.addActionListener(new ActionListener() {
try{
ResultSet rs = c.s.executeQuery(displayCustomersql);
table.setModel(DbUtils.resultSetToTableModel(rs));
e1.printStackTrace();
});
btnNewButton.setForeground(Color.WHITE);
contentPane.add(btnNewButton);
btnNewButton_1.addActionListener(new ActionListener() {
new Reception().setVisible(true);
setVisible(false);
});
btnNewButton_1.setBackground(Color.BLACK);
btnNewButton_1.setForeground(Color.WHITE);
contentPane.add(btnNewButton_1);
contentPane.add(lblNewLabel);
contentPane.add(lblNewLabel_1);
getContentPane().setBackground(Color.WHITE);
}
SCREENSHOT:
import java.awt.BorderLayout;
import java.awt.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import net.proteanit.sql.DbUtils;
import javax.swing.JTable;
import java.sql.*;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class Employee extends JFrame {
/**
*/
EventQueue.invokeLater(new Runnable() {
try {
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
});
this.dispose();
/**
* @throws SQLException
*/
//conn = Javaconnect.getDBConnection();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setContentPane(contentPane);
contentPane.setLayout(null);
contentPane.add(table);
btnLoadData.addActionListener(new ActionListener() {
try{
ResultSet rs = c.s.executeQuery(displayCustomersql);
table.setModel(DbUtils.resultSetToTableModel(rs));
catch(Exception e1){
e1.printStackTrace();
});
btnLoadData.setBackground(Color.BLACK);
btnLoadData.setForeground(Color.WHITE);
contentPane.add(btnLoadData);
JButton btnExit = new JButton("Back");
btnExit.addActionListener(new ActionListener() {
new Reception().setVisible(true);
setVisible(false);
});
btnExit.setBackground(Color.BLACK);
btnExit.setForeground(Color.WHITE);
contentPane.add(btnExit);
contentPane.add(lblNewLabel);
contentPane.add(lblJob);
contentPane.add(lblName);
contentPane.add(lblDepartment);
contentPane.add(l1);
JLabel l2 = new JLabel("Phone");
contentPane.add(l2);
contentPane.add(l3);
contentPane.add(l4);
getContentPane().setBackground(Color.WHITE);
SCREENSHOT:
7.9 Customer info:
package hotel.management.system;
import java.awt.BorderLayout;
import java.awt.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import net.proteanit.sql.DbUtils;
import java.sql.*;
import javax.swing.*;
import javax.swing.JTable;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
/**
*/
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
});
this.dispose();
/**
* @throws SQLException
*/
//conn = Javaconnect.getDBConnection();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setContentPane(contentPane);
contentPane.setLayout(null);
btnExit.addActionListener(new ActionListener() {
new Reception().setVisible(true);
setVisible(false);
}
});
btnExit.setBackground(Color.BLACK);
btnExit.setForeground(Color.WHITE);
contentPane.add(btnExit);
btnLoadData.addActionListener(new ActionListener() {
try{
ResultSet rs = c.s.executeQuery(displayCustomersql);
table.setModel(DbUtils.resultSetToTableModel(rs));
catch(Exception e)
e.printStackTrace();
});
btnLoadData.setBackground(Color.BLACK);
btnLoadData.setForeground(Color.WHITE);
contentPane.add(btnLoadData);
contentPane.add(lblId);
contentPane.add(l1);
lblNewLabel = new JLabel("Name");
contentPane.add(lblNewLabel);
contentPane.add(lblGender);
contentPane.add(table);
contentPane.add(lblCountry);
contentPane.add(lblRoom);
contentPane.add(lblStatus);
contentPane.add(lblNewLabel_1);
getContentPane().setBackground(Color.WHITE);
}
SCREENSHOT:
import java.awt.BorderLayout;
import java.awt.*;
\import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import net.proteanit.sql.DbUtils;
import javax.swing.JTable;
import java.sql.*;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
/**
*/
EventQueue.invokeLater(new Runnable() {
try {
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
});
this.dispose();
}
/**
* @throws SQLException
*/
//conn = Javaconnect.getDBConnection();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setContentPane(contentPane);
contentPane.setLayout(null);
contentPane.add(table);
btnLoadData.addActionListener(new ActionListener() {
try{
ResultSet rs = c.s.executeQuery(displayCustomersql);
table.setModel(DbUtils.resultSetToTableModel(rs));
catch(Exception e1){
e1.printStackTrace();
});
btnLoadData.setBounds(350, 500, 120, 30);
btnLoadData.setBackground(Color.BLACK);
btnLoadData.setForeground(Color.WHITE);
contentPane.add(btnLoadData);
btnExit.addActionListener(new ActionListener() {
new Reception().setVisible(true);
setVisible(false);
});
btnExit.setBackground(Color.BLACK);
btnExit.setForeground(Color.WHITE);
contentPane.add(btnExit);
contentPane.add(lblNewLabel);
contentPane.add(lblJob);
contentPane.add(lblName);
contentPane.add(lblDepartment);
contentPane.add(l1);
JLabel l2 = new JLabel("Phone");
contentPane.add(l2);
contentPane.add(l3);
contentPane.add(l4);
getContentPane().setBackground(Color.WHITE);
SCREENSHOT:
7.11Checkout:
package hotel.management.system;
import java.awt.BorderLayout;
import java.awt.*;
import java.awt.EventQueue;
import java.sql.*;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.Font;
import java.awt.event.*;
import java.awt.event.ActionEvent;
Choice c1;
/**
*/
EventQueue.invokeLater(new Runnable() {
try {
} catch (Exception e) {
e.printStackTrace();
});
this.dispose();
/**
* @throws SQLException
*/
//conn = Javaconnect.getjdbcConnection();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setContentPane(contentPane);
contentPane.setLayout(null);
l1.setBounds(300,0,500,225);
add(l1);
JLabel lblCheckOut = new JLabel("Check Out ");
contentPane.add(lblCheckOut);
contentPane.add(lblName);
c1 = new Choice();
try{
while(rs.next()){
c1.add(rs.getString("number"));
}catch(Exception e){ }
contentPane.add(c1);
l2.setBounds(290,82,20,20);
add(l2);
l2.addActionListener(new ActionListener(){
System.out.println("Hi");
try{
if(rs.next()){
System.out.println("clicked");
t1.setText(rs.getString("room_number"));
}catch(Exception e){ }
});
contentPane.add(lblRoomNumber);
t1 = new JTextField();
contentPane.add(t1);
btnCheckOut.addActionListener(new ActionListener() {
String id = c1.getSelectedItem();
String s1 = t1.getText();
try{
((Statement) c.s).executeUpdate(deleteSQL);
((Statement) c.s).executeUpdate(q2);
new Reception().setVisible(true);
setVisible(false);
}catch(SQLException e1){
System.out.println(e1.getMessage());
});
btnCheckOut.setBackground(Color.BLACK);
btnCheckOut.setForeground(Color.WHITE);
contentPane.add(btnCheckOut);
btnExit.addActionListener(new ActionListener() {
new Reception().setVisible(true);
setVisible(false);
});
btnExit.setBackground(Color.BLACK);
btnExit.setForeground(Color.WHITE);
contentPane.add(btnExit);
getContentPane().setBackground(Color.WHITE);
SCREENSHOT:
7.12Pickupservice:
package hotel.management.system;
\import java.awt.BorderLayout;
import java.awt.*;
import java.sql.*;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.Font;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
ResultSet rs = null;
Choice c1;
/**
*/
EventQueue.invokeLater(new Runnable() {
try {
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
});
}
this.dispose();
/**
* @throws SQLException
*/
//conn = Javaconnect.getDBConnection();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setContentPane(contentPane);
contentPane.setLayout(null);
contentPane.add(lblPickUpService);
contentPane.add(lblTypeOfCar);
c1 = new Choice();
try{
while(rs.next()){
c1.add(rs.getString("brand"));
}
}catch(Exception e){ }
contentPane.add(c1);
contentPane.add(lblInfo);
btnRegister.addActionListener(new ActionListener() {
try{
rs = c.s.executeQuery(SQL);
table.setModel(DbUtils.resultSetToTableModel(rs));
ss.printStackTrace();
});
btnRegister.setBackground(Color.BLACK);
btnRegister.setForeground(Color.WHITE);
contentPane.add(btnRegister);
btnExit.addActionListener(new ActionListener() {
new Reception().setVisible(true);
setVisible(false);
}
});
btnExit.setBackground(Color.BLACK);
btnExit.setForeground(Color.WHITE);
contentPane.add(btnExit);
contentPane.add(table);
contentPane.add(lblNewLabel);
contentPane.add(lblGender);
contentPane.add(lblTypeOfDriver);
contentPane.add(lblDateOfThe);
contentPane.add(lblAirport);
contentPane.add(lblAvailable);
getContentPane().setBackground(Color.WHITE);
}
SCREENSHOT:
import java.awt.BorderLayout;
import java.awt.*;
import java.sql.*;
import javax.swing.*;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import net.proteanit.sql.DbUtils;
import java.awt.Font;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
ResultSet rs = null;
Choice c1;
/**
*/
EventQueue.invokeLater(new Runnable() {
try {
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
});
this.dispose();
}
/**
* @throws SQLException
*/
//conn = Javaconnect.getDBConnection();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setContentPane(contentPane);
contentPane.setLayout(null);
contentPane.add(lblSearchForRoom);
contentPane.add(lblRoomAvailable);
contentPane.add(lblRoomType);
contentPane.add(lblRoomAvailable_1);
JLabel lblPrice_1 = new JLabel("Price");
contentPane.add(lblPrice_1);
contentPane.add(l1);
checkRoom.setBackground(Color.WHITE);
contentPane.add(checkRoom);
c1 = new Choice();
c1.add("Single Bed");
c1.add("Double Bed");
contentPane.add(c1);
btnSearch.addActionListener(new ActionListener() {
String SQL2 = "select * from Room where availability = 'Available' AND bed_type =
'"+c1.getSelectedItem()+"'";
try{
rs = c.s.executeQuery(SQL);
table.setModel(DbUtils.resultSetToTableModel(rs));
if(checkRoom.isSelected())
rs = c.s.executeQuery(SQL2);
table.setModel(DbUtils.resultSetToTableModel(rs));
ss.printStackTrace();
});
btnSearch.setBackground(Color.BLACK);
btnSearch.setForeground(Color.WHITE);
contentPane.add(btnSearch);
btnExit.addActionListener(new ActionListener() {
new Reception().setVisible(true);
setVisible(false);
});
btnExit.setBackground(Color.BLACK);
btnExit.setForeground(Color.WHITE);
contentPane.add(btnExit);
table = new JTable();
contentPane.add(table);
contentPane.add(lblCleanStatus);
getContentPane().setBackground(Color.WHITE);
SCREENSHOT:
7.14 Log out:
package hotel.management.system;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
JLabel l1,l2;
JTextField t1;
JPasswordField t2;
JButton b1,b2;
Login(){
("Login");
setLayout(null);
l1 = new JLabel("Username");
l1.setBounds(40,20,100,30);
add(l1);
l2 = new JLabel("Password");
l2.setBounds(40,70,100,30);
add(l2);
t1=new JTextField();
t1.setBounds(150,20,150,30);
add(t1);
\t2=new JPasswordField();
t2.setBounds(150,70,150,30);
add(t2);
//ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("hotel/management/system/icons/second.jpg"));
//Image i2 = i1.getImage().getScaledInstance(200,200,Image.SCALE_DEFAULT);
// add(l3);
b1 = new JButton("Login");
b1.setBounds(40,140,120,30);
b1.setFont(new Font("serif",Font.BOLD,15));
b1.addActionListener(this);
b1.setBackground(Color.BLACK);
b1.setForeground(Color.WHITE);
add(b1);
b2=new JButton("Cancel");
b2.setBounds(180,140,120,30);
b2.setFont(new Font("serif",Font.BOLD,15));
b2.setBackground(Color.BLACK);
b2.setForeground(Color.WHITE);
add(b2);
b2.addActionListener(this);
getContentPane().setBackground(Color.WHITE);
setVisible(true);
setSize(600,300);
setLocation(600,350);
if(ae.getSource()==b1){
try{
String u = t1.getText();
String v = t2.getText();
ResultSet rs = c1.s.executeQuery(q);
if(rs.next()){
new Dashboard().setVisible(true);
setVisible(false);
}else{
setVisible(false);
}catch(Exception e){
e.printStackTrace();
}else if(ae.getSource()==b2){
System.exit(0);
new Login();
Add employee:
package hotel.management.system;
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import java.awt.event.*;
import java.sql.*;
import java.util.*;
JButton b1,b2;
Choice c1;
public AddRoom() {
setContentPane(contentPane);
contentPane.setLayout(null);
ImageIcon(ClassLoader.getSystemResource("hotel/management/system/icons/twelve.jpg"));
contentPane.add(l10);
contentPane.add(l1);
t4 = new JTextField();
contentPane.add(t4);
contentPane.add(l2);
contentPane.add(comboBox);
contentPane.add(l3);
contentPane.add(comboBox_2);
contentPane.add(l4);
t2 = new JTextField();
contentPane.add(t2);
contentPane.add(l5);
contentPane.add(comboBox_3);
b1 = new JButton("Add");
b1.addActionListener(this);
b1.setBackground(Color.BLACK);
b1.setForeground(Color.WHITE);
contentPane.add(b1);
b2 = new JButton("Back");
b2.addActionListener(this);
b2.setBackground(Color.BLACK);
b2.setForeground(Color.WHITE);
contentPane.add(b2);
contentPane.setBackground(Color.WHITE);
try{
if(ae.getSource() == b1){
try{
String str = "INSERT INTO room values( '"+room+"', '"+available+"', '"+status+"','"+price+"', '"+type+"')";
c.s.executeUpdate(str);
this.setVisible(false);
}catch(Exception ee){
System.out.println(ee);
this.setVisible(false);
}catch(Exception eee){
‘
SCREENSHOT:
7,15Add driver:
package hotel.management.system;
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import java.awt.event.*;
import java.sql.*;
import java.util.*;
JButton b1,b2;
Choice c1;
new AddDrivers().setVisible(true);
public AddDrivers() {
setContentPane(contentPane);
contentPane.setLayout(null);
//l15.setBounds(400,30,500,370);
//add(l15);
contentPane.add(l1);
t1 = new JTextField();
contentPane.add(t1);
contentPane.add(l2);
t2 = new JTextField();
contentPane.add(t2);
contentPane.add(l3);
contentPane.add(comboBox);
contentPane.add(l4);
t3 = new JTextField();
contentPane.add(t3);
contentPane.add(l5);
t4 = new JTextField();
contentPane.add(t4);
contentPane.add(l6);
contentPane.add(comboBox_1);
contentPane.add(l7);
t5 = new JTextField();
contentPane.add(t5);
b1 = new JButton("Add");
b1.addActionListener(this);
b1.setBackground(Color.BLACK);
b1.setForeground(Color.WHITE);
contentPane.add(b1);
b2 = new JButton("Back");
b2.addActionListener(this);
b2.setBackground(Color.BLACK);
b2.setForeground(Color.WHITE);
contentPane.add(b2);
contentPane.setBackground(Color.WHITE);
try{
\if(ae.getSource() == b1){
try{
String str = "INSERT INTO driver values( '"+name+"', '"+age+"', '"+gender+"','"+company+"', '"+brand+"',
'"+available+"','"+location+"')";
c.s.executeUpdate(str);
this.setVisible(false);
}catch(Exception ee){
System.out.println(ee);
}
else if(ae.getSource() == b2){
this.setVisible(false);
}catch(Exception eee){
SCREENSHOT:
7,16Add rooms:
package hotel.management.system;
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import java.awt.event.*;
import java.sql.*;
import java.util.*;
JButton b1,b2;
Choice c1;
new AddRoom().setVisible(true);
public AddRoom() {
setContentPane(contentPane);
contentPane.setLayout(null);
//ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("hotel/management/system/icons/twelve.jpg"));
//l15.setBounds(400,30,500,370);
// add(l15);
contentPane.add(l10);
contentPane.add(l1);
contentPane.add(t4);
contentPane.add(comboBox);
contentPane.add(l3);
contentPane.add(comboBox_2);
contentPane.add(l4);
t2 = new JTextField();
contentPane.add(t2);
contentPane.add(l5);
contentPane.add(comboBox_3);
b1 = new JButton("Add");
b1.addActionListener(this);
b1.setForeground(Color.WHITE);
contentPane.add(b1);
b2 = new JButton("Back");
b2.addActionListener(this);
b2.setBackground(Color.BLACK);
b2.setForeground(Color.WHITE);
contentPane.add(b2);
contentPane.setBackground(Color.WHITE);
try{
if(ae.getSource() == b1){
try{
String str = "INSERT INTO room values( '"+room+"', '"+available+"', '"+status+"','"+price+"', '"+type+"')";
c.s.executeUpdate(str);
this.setVisible(false);
}catch(Exception ee){
System.out.println(ee);
this.setVisible(false);
}
}catch(Exception eee){
SCREENSHOT:
8.CONCLUSION:
In conclusion, developing a hotel management system using Eclipse and MySQL involves creating a
software application for managing the operations of a hotel. This system would include various modules
such as booking and reservation management, customer management, staff management, inventory
management, and financial management. To develop such a system, one needs to have a good understanding
of programming languages, database design concepts, and the requirements of the hotel management
system. With these skills and tools, it is possible to create an efficient and effective hotel
management system. The staff management module can help manage employee schedules, track attendance,
and assign tasks, while the inventory management module can help maintain accurate stock levels and
automate purchasing. The financial management module can help track revenues, expenses, and profits, and
generate reports for analysis.
9.REFERENCE:
Here are some references that may be useful for learning more about hotel management systems, Eclipse,
and MySQL:
These references provide a good starting point for learning more about hotel management systems, as well
as the tools and technologies involved in their development.