You are on page 1of 65

INTRODUCTION

HOTEL BILLING SYSTEM

This project has been made for storing stock and customer records
like booking number, customer number, name , phone number,
charges for room etc. It contains addition, modification, deletion and
searching of bills, generating of bills as per requirement. Total
amount is being calculated automatically.
AIM

The main aim of my project is to create bills as per entered

booking number by the user. It helps to store the records of

customers in particular table [Items] and these records can be easily

accessed by the person in fast manner.


INTRODUCTION
TO
COMPUTER
INTRODUCTION TO COMPUTERS

INTRODUCTION:
Although human can't do a lot of work, but nature
compensated the entire shortcoming by ability to think and
to solve problem of different types, it is only because of this
ability that man is always looking far word to invent
machines of various type in order to make his life safe and
comfortable.
Computer is one of his significant creations. Compute are
not only extension of man ability to computer but also help
him in storing and retaining date. It can even take logical
problems, in face the computer have come in up such a big
way that their presents is felt in every field of life
education, business, research medicine air flight, railways
schedules and process control etc.
1. Development of Computer
Till seventeenth century efforts were made by many people
to develop calculating devices such as "NAPIER"S BONES"
and also mechanical calculators, the notable being Pascal's
and Leninist machines was that these ware quit show in their
operations and needed human intervention at every stage.
Moreover this device lacked reliability and accuracy. Human
efforts continued to design and develop devices which could
be fast reliable accurate and fully automatic. These efforts
resulted in development of modem.
Software Organization
All the software can be divided in to three main parts:
A). Application Software
They Are these software, which are developed according to.
The requirements of the user. Such as payroll printing
B). Utility Software
They are that software, which assist the user 10 which
developed application software. Such as editors and linkers.
C). System Software
System software are those software which are generally
supplied by the manufacture, they include language
operating system and other utility program. If allows the
user communicate with his system and are necessary are the
proper working of the computer.
Type of Processing Modes

There are some types of processing modes:


Interactive Processing Mode
Interactive processing is related to direct to direct link between
the user and computer. In this type of processing the user
enters data into the computer and receives output directly.
Real Time processing Mode
Real time processing is applied to any system. Which
produced and intermediates response as result of inputting
data? The essential feature of real time processing is that
inputted data must be purchased so that other instructions can
be taken promptly.
Batch Processing
In batch processing, several programs are mode and placed
before the computer to process them one by one.
Time Sharing Processing
The sharing is an ability of the computer to process several
programs simultaneously. Users of time-sharing system are
link with the computer by a terminal. The time-sharing
supervisor gives each job in a short period of time during
which it is in control of the central processing unit.
Wide Area Network (WAN)
In WAN many computers are linked through satellite
communication at a great distance from each other.
Local Area Network (LAN)
In LAN to more computers are linked by wire, so that one
computer can access another computer's memory business in
LAN it is necessary that computer are physically linked with
each other through cables and are in the same geographical
LAN. Example Ring, Star.
Metropolitan Area Network (MAN)
H.
In developed nations public service institution of a
metropolitan link hospital, Police station, a computer network
links fare department etc., so that each can share the
information received by one end at accordingly.
Computer virus
Computer virus is a set of program, which destroys the whole
system.

2. Social Demonstration of Computerization

A.) Beneficial Impact:

The drudgery of repetitive type of operation is avoided speed

of processing helps more timely decision-making. Public

service can be made more effective with the help of

computers. Which is a perennial problem faced by every

society. The frontiers of nations and countries have stuck a

great deal by the quantity and speed of communication

technology. Computer is applicable to various fields, links

industries, life education etc.


B). Harmful Impact:

The individual dependencies on computer can cause untold

miseries like loss of saved data reduction in numerical ability,

infernally complex, effects of radiation due to continues

exposure to the VDU


NEEDS OF
COMPUTERIZATIO
N
NEED OF COMPUTERIZATION

Advantage of Computerizes Management

Having a computer at hand provide a vast range of advantage of


our day of .day life same of them are:

Speed: As the definition of computer say Computer is an


electronic machine which process data many time faster than
human being" speed is a vital part of your life the computer
process large volumes of data at a very high rate of speed which
help us tasking quick effective decisions. A modem day computer
can process 500 millions instructions in a second.

Accuracy: The information processed by a computer has a high


rate of accuracy. A modern day computer can provide
information up to 99 'place of decimals and more the accuracy of
the computer is maintained through the process.
Versatility: A computer can perform verity of tasks for a human
being.
Today computer is associated in virtually every field of our life
form space research and global communication to provide shops.
Departmental stores, from hi tech fighter plans to modern day
kitchen machine.
Diligence: A computer being a machine does not loose its power
during long work schedulers. The qualities of a computer are
unchanged throughout the entire work, its accuracy is maintained
from the first record to the last record it does not feed tiredness
and does not loose temper.
Storage: In modern dyes large amount of data is required to
processed and stored which requires long and laborious file
maintenance and report building, the space required to effectively
store must vast amount of data is much more a computer can
store large amount data in its secondary storage devices such as
floppy disk, CD etc. Thus saving valuable space for other
important tasks.
Introduction to
JAVA
Java (programming language):-
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 compiled Java code can run on all platforms
that support Java without the need for recompilation. Java
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 client-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 relicensed most of
its Java technologies under the GNU 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 plugin for applets).

The latest version is Java 8 which is the only version currently


supported for free by Oracle, although earlier versions are supported
both by Oracle and other companies on a commercial basis.
NEED OF THE SYSTEM

The Package is developed to help the department maintaining the Hotel


details, earlier the records where maintained manually, with the help of
this package the concerned departments will be able to improve the
productivity, reduce the time, cost factors associated with the system. The
automation of the system will help the organization in proper maintenance
of the record, less manpower, less man-days, less cost, proper & accurate
functioning.

The basic need for the package was to automate the whole procedure of
maintaining of Hotel details, earlier it was all done manually. By
developing this package lot of burden was removed from the department,
which was maintaining Hotels details. It improved the efficiency, reduced
the cost, and reduced the time need to do the work manually. With the help
of this package the past details of the Hotels can assessed and reports can
be generated on this details.

In brief we can say this system was required to automate the processing of
Hotels details, which was done manually before the development of the
package. Earlier all the information / data pertaining to the Hotels was
maintained manually or we can say it was on paper, hence it created a
problem for the organization/ school, how to manage it properly. With the
help of this system the organization/school is able to maintain the data
properly & accurately.
Why System was build?

Earlier, data pertaining to Hotels was maintained manually.


Manual system was not efficient.

Cost of maintaining data manually was bigger or huge.

Large manpower was required.

The procedure was error prone, it was not accurate.

Manual system was not suited for electronic exchange of data.

Solution?

The solution for all this problem was to automate the system, automation
of the Hotels data maintenance would reduce the manpower, man days
will result in accurate data & above all increase the efficiency of the
concerned department.
FEASIBILITY STUDY

Feasibility is the test of the system it helps in deciding whether it is viable


to go through the project or not. Feasibility study studies the system &
tells whether to develop the system or not. In lay mans terms it can be
described as the test of the system & if the system passes in the test then it
is viable to develop the project otherwise not or we can say feasibility
study checks whether project is feasible or not.

Feasibility has four solid dimensions:

1. Technology
2. Finance

3. Time

4. Resources

The feasibility of the system SCHOOL Data Management System is


viewed with the help of these four dimensions.

Technology:
This system uses one of the simplest technologies in
use, for the development purpose it uses simple to use & easily available
technology. This system is based on windows like interface, which is very
easy to use. The package is been developed for the department, which is
not very familiar with software hence technology used, must be easily
understandable, because of which windows like interface has been chosen.
The technology used in this project is JAVA i.e. Java, M S Access & DAO
controls. Java helps in providing windows like environment. This system
uses menu-based approach in which every thing is given with the help of
menus.

Finance:
This dimension measures the system in respect to money or we can say
funds. This dimension checks whether its viable to spend the required
amount on the system or it will be a waste. There is no problem of finance
in this project because it uses simple technology, which is very easy to
install. This system is been developed for a standalone computer hence for
this system hardware requirement is very low. For this system to be
developed & installed properly we require very easily available
technologies & very basic hardware and all these requirements doesnt
cost much.

Time:
This particular dimension measures the systems worth in respect to time,
which is one of the most important factors to be considered. In this project
time factor is very important this system is scheduled to be installed in one
months time. This system is not very big & hence can be completed within
the time period it requires approx. 30 man-days of work. Time is a crucial
factor to be considered & we can say this system can be developed within
the required time period.
Resources:
This dimension takes into count the recourses required to develop the
system. For this particular system the resources required are quite nominal
which can be fulfilled, the resources required for this system are basic
hardware, an operating which is compatible with JAVA

With the help of all these dimension we can measure the feasibility of the
system & can decide whether to go forward with the project or not. By
take in count the dimension & their role in this particular system we can
say this system is feasible from all these dimension point of view & it is
viable to go through the project.
SCOPE OF THE SYSTEM

Scope of the system measures the scope of the project, which is going to
be developed. Answering following aspects can answer the project scope:

1. Context
2. Information objective

3. Function & Performance

4. Interfaces

The system SCHOOL data management system is a data management of


Hotels. All the details of the Hotels are managed with the help of this
package i.e. their Personal information, fees information & their report
generation, with the help of this package the organization can maintain &
manipulate Hotels data. This package has the provision for adding new
records, editing old records, viewing the database, searching facility,
report generation, help i.e. how to use the package & etc. Scope of the
system can be measured with the help of the dimensions.

Context:
This project is related to management of Hotels data and the daily
activities of the authorities with the help of this package the user of this
package, which is the department i.e. administrative will be able to
maintain the data through the computer which will help in increasing he
efficiency, accuracy of the department as well as help in electronic inter
change of the data. Administrative department can use this package to
check for the details of the Hotels, whether they have paid their fees
amount or whether it is due to them, through which receipt no. it was paid
they can study the past records analyze the trends.

Information objective:
Basically this is related to the Inputs & Outputs to the system. In other
way we can say it is related to the inputs required by the system & outputs
generated by the system.

This package is basically data management package, in which the inputs


given by the user is itself the output of system it performs few calculation
like the total cash received from the Hotels. We can say it is data
management package, it provides the user with front end which is very
easy to use.

1. Inputs:
The input to the system is username & password for the system
security, their Personal details like Name, Address, Phone number,
admission details, roll no for data management, their fees details like
admission fees, tuition, computer fee & etc .
2. Outputs:
The output for this system is the maintained records, personal
details, fees details, fee status & report generated. The outputs of the
system are the records that were added in the database as well as the
reports that are generated with the help of he data in the database.
Function & Performance:
This dimension measures the scope of the system with the help of
functions & performance of the system. The basic function performed by
the system is of data management & report generation.

The system performs various functions like:

1. Security:
The first function of the system is to provide security from
unauthorized access to the data, which is provided with the help of
user name & password at the beginning of the package. This system
is been developed for a single user hence no rights are employed or
we can say administrator is only the user.
2. Data maintenance:
The most important function of the system is to maintain Hotel
Management, the data is maintained with the help of different menus
like adding, editing, viewing, searching & etc. There are different
kinds of data in the system like personal information, fees
information & cash details with the help of the front end data is
managed.

3. Report generation:
The last function of the system is to generate reports of the data like
Hotel details report, cash report, fee status report & etc. With the
help of this report the data can be electronically exchanged as well
as the reviewing of policies can be done with the help of reports.

These are some of the basic function performed by the system


Hotel Management.
Interfaces:
Interfaces are the link between the user and the system, basically we can
say interfaces are the objects through which user of the system interacts
with the system. This system has different interfaces through which user
interacts with the system they are:

1.Login interface:
This is the first interface in which user is required to
enter the username & password if the password is
correct then access is granted otherwise not. User has
got three attempts to enter the correct password; if
he is not able to enter the correct password in three
attempts then the system is exited.
2. Data maintenance:

This is the most important interface in the system in


which the user interacts with the system to store the
data or to retrieve the data from the database, this
interface has got many sub parts like addition of
records, editing of records, searching of records & etc.
3. Reports:
This interface is the output for the system in which
the user receives the results or output, which is
required in the form of reports like cash details, Hotel
details & fee status.
OBJECTIVE

The following are the main objectives of the project titled "Hotel
Management ":

The package provides the means of security, which makes sure that only
the concerned modules and screens are accessible to the particular
department after verifying one's validity and all other modules and screens
remains disable. The package is meant to maintain and provide complete
details about Hotels such as personal details, their fees details and cash
details.

The basic objective of the system is to manage the Hotels data efficiently
& accurately. It provides the user of the system with personal details of the
Hotels their name, address, phone & etc, it provides the user with fees as
well as cash details of the Hotels, how much they have paid, what is the
status of the fees i.e. how many have paid fees & how many are yet to pay
the fees. It also provides the user with details of cash like conveyance
details.

Hotel Management package is a Management & Information project,


which has these objectives:

Hotel Management will be highly user friendly, management information


system that will not help only Accounts, Management & Administrative
system to gather, communicate, computerize but also help to act on critical
information much faster and in a better manner. The solution envisages
linking of different departments to streamline the flow of data and timely
availability of information at both the ends. Further, it also aids in
generating, maintaining user definable Queries, Reports. Salient Features
of the application will be as defines below:

1. Owner of data to be the owner of the database


2. Capture of information at the source of generation

3. Sharing of data

4. Minimizing duplicate work

5. Reducing inconsistency by eliminating multiple databases of the


same data

6. Consolidation of data at all levels

Outlined objectives of the system:

User friendliness:
The package developed is easy to learn and understand. Even a new user
can use the system effectively, without any difficulty. The help and user
manuals are provided to solve the further queries of the users. With the
help of the user manuals the user can get the full details of the
functionality of the system.

User satisfaction:
The package is such that it stands up to the users
expectations. The system is successful in generating the reports of the task
status and details of the Hotel. The package is currently being successfully
run in the organization.

Response time:
The response time for all the operations is less. All the report generations
and the listing tasks are performed in significant time. The queries used
are so as to reduce the execution time of query processing.

Error handling:
Responses to users errors and undesired situation have been taken care of
to ensure that the system operates without halting. Proper error handling
codes are put with the codes.

Security and robustness:


The package is able to avoid or tackle disastrous action.
It allows only the authentic user to access the software as it is protected by
the user name and the password. All the administrative tasks are allowed
to the project leader only so the illegal intervention is not possible.

Modularity:
The package has relatively independent and single
function parts that are put together to make complete system. Thus as a
result of this modular approach the system, in spite of being robust is not
cumbersome. It also contributes for the fast execution of the system.

Maintainability:
The system is able to decrease the time and effort for
program maintenance. The full details of the projects being undertaken,
and the task status corresponding to each Hotel is stored carefully and the
reports are generated as per the requirement.

Timeliness:
The package is able to operate well under normal peak
and recovery conditions.
OPERATING ENVIORNMENT

The system is developed in Java / M S Access and run under windows


95/98 & upper versions.

Java:
Java is event driven programming language, which is used to develop
front end for the application. This is called event driven because
every action of the user is an event & the application is driven with
the help of these events, which are programmed with the help of Java.
In Java there are forms, Controls, reports & many more things to
provide the user with overwhelming experience of user friendliness.
Java is a programming language for windows environment &
provides the user with windows like interface.

M.S. Access:
Access is a Relational Database Management System
(RDBMS) that you can use to store and manipulate large amounts of
information. Because its tools are user-friendly and because it is a
powerful development environment, Access is equally appropriate for
novices and MIS professionals.
Beginners can use Access to:

1. Store and manage various types of inventories.


2. Log information such as auto repairs for cars, doctor visits, etc.

3. Create contact management databases that can track contacts,


but phone calls, meetings, and any other interactions with
contacts.

Developers can use Access to:

1. Create applications that manage survey results.


2. Manage front ends for enterprise-wide database such as SQL
server.

3. Establish help-desk applications.

Access is an object-oriented program; that is, everything in Access is


an object, including the application itself. Each object has properties
that define how it looks and performs. The uses of Access are limited
only by the needs of an organization and the imagination of the user
or developer.
DESIGN OF THE SYSTEM

TOPICS COVERED

I. HARDWARE / SOFTWARE REQUIREMENT


II. SYSTEM REQUIREMENT
III. DFDS
IV. ER-DIAGRAM
V. FLOWCHART
VI. BLOCK DIAGRAM
VII. FILE DESIGN
VIII. MENU CHART
HARDWARE & SOFTWARE REQUIREMENT

HARDWARE REQUIREMENT:

Hardware requirement are the basic need of the system or the


package, which is been developed and will be deployed upon the
system, which should have these basic components or fulfill these
basic hardware needs of these package.

The following hardware is recommended for the user.

Microprocessor : PIII500 MHz.

Memory : 128 MB SDRAM DIHM

Cache Memory : 512 KBL2

Upgrade ability : Processor, RAM and HDD Upgradeable

HDD : 9.1 GB Wide ultra SCSI-3 HDD

Floppy Drive : 24x CD ROM Drive (IDE)

Keyboard : 104 Keys Enhanced Keyboard


Mouse : 2 Button Scroll Mouse

Graphics : 1024x768, 256 colors non-interlaced on


PCL Local Bus

Monitor : 15 SGA Color monitor

Software Requirements:
Software requirement are the basic software needs of the system or the
package to work properly & efficiently.

Operating System : Windows-98 & upper versions

RDBMS : MS Access 97

For editing the code of the package:


Application program : Java
SYSTEM REQUIREMENTS SPECIFICATION

The function and performance allocated to software as part of system


engineering are refined by establishing a complete information
description, a detailed functional and behavioral description, an
indication of performance requirements and design constraints,
appropriate validation criteria, and other data pertinent to
requirements. The outlines of system requirement specification are:

Introduction:

This System Requirement Specifications Document forms the basis for


the design and development of the Hotel Management. The purpose
of this document is to define all the processes involved in the function
of Hotel Management. The requirements of the software relating to the
functionality, interfaces, logical database requirements and various
other aspects of the software are also explicitly defined. The SRS
document will also act as the basis for understanding between the end-
user and the designer/developer.
Information Description:
The development of this system assists in the
maintenance of the information and to fulfill the complete software
requirements of the package.

Functional Description:
A processing narrative is provided for each
function, design constraints are stated and justified, performance
characteristics are stated and diagram is included.

Validation and Criteria:


For successful implementation of the system we should define the
performance bounds, and expected software response. At the time of
creating new entry, system performs different types of validations like
user can not overwrite the existing information, it asks the user, this
information already exist and also many feature.
TABLE STRUCTURE OF REPORT
LOG IN
On Top :-
import javax.swing.JOptionPane;

Button(welcome) :-
String n = new String(jPasswordField1.getPassword());
String p = new String(jPasswordField2.getPassword());
if(n.equals("jasmeet")&&p.equals("nishant"))
new welcome().setVisible(true);
else
JOptionPane.showMessageDialog(null,"Incorrect password");
WELCOME
Button(addition) :-
new add().setVisible(true);

Button(modify) :-
new modify().setVisible(true);

Button(delete) :-
new delete().setVisible(true);

Button(generate bill)
new generate bill ().setVisible(true);

Button(delete) :-
System.exit(0);
ADD RECORDS
On Top:-
import java.sql.*;
import javax.swing.JOptionPane;
Button(save):-
try
{
Class.forName("java.sql.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/pan
pacific","root","");
int g,k=0;
String rt;
rt=jComboBox1.getSelectedItem().toString();
if(rt.equals("Single"))
k=2000;
else if(rt.equals("Double"))
k=2500;
else if(rt.equals("Delux"))
k=4000;
jTextField6.setText(""+k);
int a=Integer.parseInt(jTextField1.getText());
String b = jTextField2.getText();
Long c=Long.parseLong(jTextField3.getText());
int d=Integer.parseInt(jTextField4.getText());
int e=Integer.parseInt(jTextField5.getText());
g=k*e;
jTextField7.setText(""+g);
String query="insert into hotel
values("+a+",'"+b+"',"+c+","+d+","+e+","+k+","+g+",'"+rt+"');";
Statement stmt=con.createStatement();
stmt.executeUpdate(query);

JOptionPane.showMessageDialog(null,"Saved Successfully");
stmt.close();
con.close();
}

catch(Exception e)
{
JOptionPane.showMessageDialog(null,error);
}
Button(new):-
jTextField1.setText("");
jTextField2.setText("");
jTextField3.setText("");
jTextField4.setText("");
jTextField5.setText("");
jTextField6.setText("");
jTextField7.setText("");
Button(back):-
new welcome().setVisible(true);
MODIFY RECORDS
On top:-
import java.sql.*;
import javax.swing.JOptionPane;
Button(search):-
try {
Class.forName("java.sql.Driver");
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/pan
pacific","root","");
Statement stmt =con.createStatement();

String query = "SELECT * FROM hotel WHERE bn = " +


jTextField1.getText() + ";";

ResultSet rs = stmt.executeQuery(query);
int a,b,d,e,f,h;
String g,rot;
if (rs.next())
{
a =rs.getInt("bn");
g =rs.getString("name");
long c=rs.getLong("pn");
d=rs.getInt("rn");
e=rs.getInt("nod");
f=rs.getInt("cpd");
h=rs.getInt("ta");
rot=rs.getString("rt");
jTextField2.setText(g);
jTextField3.setText(""+c);
jTextField4.setText(""+d);
jTextField5.setText(""+e);
jTextField6.setText(""+f);
jTextField7.setText(""+h);
jComboBox1.setSelectedItem(rot);

}
else
{

jTextField1.setText("");
jTextField2.setText("");
jTextField3.setText("");
jTextField4.setText("");
jTextField5.setText("");
jTextField6.setText("");
jTextField7.setText("");

JOptionPane.showMessageDialog(null, "No such record


found");
}
} //end of try
catch(Exception e) {
JOptionPane.showMessageDialog(null,e);
}
Button(calculate):-
int a,d=0,k;
a= Integer.parseInt(jTextField5.getText());
String r;
r=jComboBox1.getSelectedItem().toString();
if(r.equals("Single"))
d=2000;
else if(r.equals("Double"))
d=2500;
else if(r.equals("Delux"))
d=4000;
jTextField6.setText(""+d);
k=d*a;
jTextField7.setText(""+k);
Button(update):-
int ans;
String query;

try {
Class.forName("java.sql.Driver");
Class.forName("com.mysql.jdbc.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/panpacifi
c","root","");
Statement stmt =con.createStatement();
int g,k=0;
String r,rot;
r=jComboBox1.getSelectedItem().toString();
if(r.equals("Single"))
k=2000;
else if(r.equals("Double"))
k=2500;
else if(r.equals("Delux"))
k=4000;
jTextField6.setText(""+k);
int a=Integer.parseInt(jTextField1.getText());
String b = jTextField2.getText();
Long c=Long.parseLong(jTextField3.getText());
int d=Integer.parseInt(jTextField4.getText());
int e=Integer.parseInt(jTextField5.getText());
g=k*e;
jTextField7.setText(""+g);
{query = "update hotel set
bn="+a+",name='"+b+"',pn="+c+",rn="+d+",nod="+e+",cpd="+k+",t
a="+g+",rt='"+r+"';";
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null, "done");
jTextField1.setText("");
jTextField2.setText("");
jTextField3.setText("");
jTextField4.setText("");
jTextField5.setText("");
jTextField6.setText("");
jTextField7.setText("");
} //end of try
} catch(Exception e) {
JOptionPane.showMessageDialog(null,e);
}
Button(back):-
new welcome().setVisible(true);
DELETE RECORDS :-
On top:-
import java.sql.*;
import javax.swing.JOptionPane;
Button(search):-
try {
Class.forName("java.sql.Driver");
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/pan
pacific","root","");
Statement stmt =con.createStatement();

String query = "SELECT * FROM hotel WHERE bn = " +


jTextField1.getText() + ";";

ResultSet rs = stmt.executeQuery(query);
int a,b,d,e,f,h;
String g,rot;
if (rs.next())
{
a =rs.getInt("bn");
g =rs.getString("name");
long c=rs.getLong("pn");
d=rs.getInt("rn");
e=rs.getInt("nod");
f=rs.getInt("cpd");
h=rs.getInt("ta");
rot=rs.getString("rt");
jTextField2.setText(g);
jTextField3.setText(""+c);
jTextField4.setText(""+d);
jTextField5.setText(""+e);
jTextField6.setText(""+f);
jTextField7.setText(""+h);
jComboBox1.setSelectedItem(rot);

}
else
{

jTextField1.setText("");
jTextField2.setText("");
jTextField3.setText("");
jTextField4.setText("");
jTextField5.setText("");
jTextField6.setText("");
jTextField7.setText("");

JOptionPane.showMessageDialog(null, "No such record


found");
}
} //end of try
catch(Exception e) {
JOptionPane.showMessageDialog(null,e);
}
Button(delete) :-
int ans;
String query;

try {
Class.forName("java.sql.Driver");
Class.forName("com.mysql.jdbc.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/panpacifi
c","root","");
Statement stmt =con.createStatement();

{query = "DELETE FROM hotel WHERE bn =


"+jTextField1.getText()+ ";";
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null, "Record successfully
deleted");
jTextField1.setText("");
jTextField2.setText("");
jTextField3.setText("");
jTextField4.setText("");
jTextField5.setText("");
jTextField6.setText("");
jTextField7.setText("");
} //end of try
} catch(Exception e) {
JOptionPane.showMessageDialog(null,e);
}
Button(back) :-
new welcome().setVisible(true);
GENERATE BILL :-
Button(search):-
try {
Class.forName("java.sql.Driver");
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/pan
pacific","root","");
Statement stmt =con.createStatement();

String query = "SELECT * FROM hotel WHERE bn = " +


jTextField1.getText() + ";";

ResultSet rs = stmt.executeQuery(query);
int a,b,d,e,f,h;
String g,rot;
if (rs.next())
{
a =rs.getInt("bn");
g =rs.getString("name");
long c=rs.getLong("pn");
d=rs.getInt("rn");
e=rs.getInt("nod");
f=rs.getInt("cpd");
h=rs.getInt("ta");
rot=rs.getString("rt");
jTextField2.setText(g);
jTextField3.setText(""+c);
jTextField4.setText(""+d);
jTextField5.setText(""+e);
jTextField6.setText(""+f);
jTextField7.setText(""+h);
jComboBox1.setSelectedItem(rot);

}
else
{

jTextField1.setText("");
jTextField2.setText("");
jTextField3.setText("");
jTextField4.setText("");
jTextField5.setText("");
jTextField6.setText("");
jTextField7.setText("");

JOptionPane.showMessageDialog(null, "No such record


found");
}
} //end of try
catch(Exception e) {
JOptionPane.showMessageDialog(null,e);
}
Button(back):-
new welcome().setVisible(true);
MERITS

1. Records can be stored in fast manner.

2. Any record can be easily accessed.

3. Bill can be generated as per entered bill number and bill number

is settled as primary key in the table so that no duplicate entry

can be maintained against bill number.


DE-MERITS

1. Due to failure of electricity, no work can be processed.

2. No multiple bills can be generated.

3. Once records are being deleted cant be rollback again to

recover them.
Conclusion
Hotel Bill Generating System has been prepared to reduce manual
work and with the help of this project total amount to be paid is being
calculated automatically in fast manner.

You might also like