Java Report
Java Report
Chapter-1
INTRODUCTION
A Java web application is a collection of dynamic resources (such as Servlets, Java Server Pages,
Java classes and jars) and static resources (HTML pages and pictures). A Java web application can
be deployed as a WAR (Web Archive) file.
The web application runs on the server and people can access it there. The server is either a real
machine (with CPU, memory, hard disk, etc.) or a virtual server which is basically a machine
which is separated by software into smaller machines.
Java has strong support for web development. While Java on the desktop, with the notable
exception of Eclipse RCP based application was never a huge success, Java is frequently used at
the server side. Web applications are by nature distributed applications, meaning that they are
programs that run on more than one computer and communicate through a network or server.
Specifically, web applications are accessed with a web browser and are popular because of the
ease of using the browser as a user client. Web applications are used for web mail, online retail
sales, discussion boards, weblogs, online banking, and more. One web application can be accessed
and used by millions of people.
Like desktop applications, web applications are made up of many parts and often contain mini
programs, some of which have user interfaces, and some of which do not require a graphical user
interface (GUI) at all. Also, many applications use only the Java programming language, which is
ideal because of its versatility. The JDBC API allows you invoke database SQL commands from
Java programming language methods. You can use the JDBC API in a servlet, JSP technology
page, or an enterprise bean when you need to access the database. The JDBC API has two parts:
an application-level interface that application components use to access a database and a service
provider interface to attach a JDBC driver to the Java EE platform.
Chapter-2
Users of the Application: Anyone who surfs the internet or anyone who visits the particular
site.
Features of Application:
System connectivity
Valid user login
Upload files to online drive
Cost efficiency
User friendly environment
Data security & reliability
Fast data insertion & retrieval
Easy performance check
System Specifications:
Hardware Requirements:
Pentium – IV (Processor)
256 MB Ram
512 KB Cache Memory
Hard disk 10 GB
Microsoft Compatible 101 or more Key Board
Software Requirements:
Chapter-3
SYSTEM ANALYSIS
FEASIBILITY ANALYSIS
The analysis of structure of hotel management information system uses the technical & economic
aspects.
Economic feasibility analysis mainly assesses the construction project of the funding needs and
capital efficiency, including budget estimates, the input-output ratio, payback period of
investment, investment benefit analysis, and so on.
Chapter-4
SYSTEM DESIGN
INTRODUCTION:
Design is the first step in the development phase for any techniques and principles for the
purpose of defining a device, a process or system in sufficient detail to permit its physical
realization.
Once the software requirements have been analyzed and specified, the software design involves
three technical activities - design, coding, implementation and testing that are required to build
and verify the software.
The design activities are of main importance in this phase, because in this activity, decisions
ultimately affecting the success of the software implementation and its ease of maintenance are
made. These decisions have the final bearing upon reliability and maintainability of the system.
Design is the only way to accurately translate the customer’s requirements into finished software
or a system.
Design is the place where quality is fostered in development. Software design is a process
through which requirements are translated into a representation of software. Software design is
conducted in two steps. Preliminary design is concerned with the transformation of requirements
into data.
A Java package organizes Java classes into namespaces, providing a unique namespace for each
type it contains. Classes in the same package can access each other's package-private and protected
members. Java packages can be stored in compressed files called JAR files, allowing classes to be
downloaded faster as groups rather than individually.
In general, a package can contain the following kinds of types: classes, interfaces, enumerations,
and annotation types. A package allows a developer to group classes (and interfaces) together.
These classes will all be related in some way – they might all have to do with a specific application
or perform a specific set of tasks. Programmers also typically use packages to organize classes
belonging to the same category or providing similar functionality.
In a Java source file, the package that this file's class or classes belong to is specified with the
package keyword. This keyword is usually the first keyword in the source file. At most one
package declaration can appear in a source file.
package java.awt.event;
To use a package's classes inside a Java source file, it is convenient to import the classes from the
package with an import declaration. The following declaration
import java.awt.event.*;
imports all classes from the java.awt.event package, while the next declaration
import java.awt.event.ActionEvent;
imports only the ActionEvent class from the package. After either of these import declarations, the
ActionEvent class can be referenced using its simple class name:
A Java class file is a file (with the .class filename extension) containing Java bytecode that can
be executed on the Java Virtual Machine (JVM). A Java class file is usually produced by a Java
compiler from Java programming language source files (.java files) containing Java classes
(alternatively, other JVM languages can also be used to create class files). If a source file has
more than one class, each class is compiled into a separate class file.
JVMs are available for many platforms, and a class file compiled on one platform will execute
on a JVM of another platform. This makes Java applications platform-independent.
Local variables − Variables defined inside methods, constructors or blocks are called
local variables. The variable will be declared and initialized within the method and the
variable will be destroyed when the method has completed.
Instance variables − Instance variables are variables within a class but outside any
method. These variables are initialized when the class is instantiated. Instance variables
can be accessed from inside any method, constructor or blocks of that particular class.
Class variables − Class variables are variables declared within a class, outside any
method, with the static keyword.
A java object is a combination of data and procedures working on the available data. An object
has a state and behavior. The state of an object is stored in fields (variables), while methods
(functions) display the object’s behavior. Objects are created from templates known as classes.
In java, an object is created using the keyword “new”.
A JAR file allows Java runtimes to efficiently deploy an entire application, including its classes
and their associated resources, in a single request. JAR file elements may be compressed,
shortening download times. A JAR file may contain a manifest file, that is located at META-
INF/MANIFEST.MF . The entries in the manifest file describe how to use the JAR file. For
instance, a Class path entry can be used to specify other JAR files to load with the JAR.
4.3 SERVLET
A Java servlet processes or stores a Java class in Java EE that conforms to the Java Servlet API, a
standard for implementing Java classes that respond to requests. Servlets could in principle
communicate over any client–server protocol, but they are most often used with the HTTP. Thus
"servlet" is often used as shorthand for "HTTP servlet". Thus, a software developer may use a
servlet to add dynamic content to a web server using the Java platform. The generated content is
commonly HTML, but may be other data such as XML and more commonly, JSON. Servlets can
maintain state in session variables across many server transactions by using HTTP cookies, or
URL mapping.
The Java servlet API has, to some extent, been superseded by two standard Java technologies for
web services:
The Java API for RESTful Web Services (JAX-RS 2.0) useful for AJAX, JSON and REST
services, and the Java API for XML Web Services (JAX-WS) useful for SOAP Web Services.
To deploy and run a servlet, a web container must be used. A web container (also known as a
servlet container) is essentially the component of a web server that interacts with the servlets. The
web container is responsible for managing the lifecycle of servlets, mapping a URL to a particular
servlet and ensuring that the URL requester has the correct access rights.
The Servlet API, contained in the Java package hierarchy javax.servlet, defines the expected
interactions of the web container and a servlet.
Java Database Connectivity (JDBC) is an application programming interface (API) for the
programming language Java, which defines how a client may access a database. It is a Java-based
data access technology used for Java database connectivity. It is part of the Java Standard Edition
platform, from Oracle Corporation. It provides methods to query and update data in a database,
and is oriented towards relational databases. A JDBC-to-ODBC bridge enables connections to any
ODBC-accessible data source in the Java Virtual Machine (JVM) host environment.
JDBC allows multiple implementations to exist and be used by the same application. The API
provides a mechanism for dynamically loading the correct Java packages and registering them
with the JDBC Driver Manager. The Driver Manager is used as a connection factory for creating
JDBC connections.
JDBC connections support creating and executing statements. These may be update statements
such as SQL's CREATE, INSERT, UPDATE and DELETE, or they may be query statements such
as SELECT. Additionally, stored procedures may be invoked through a JDBC connection. JDBC
represents statements using one of the following classes:
Statement – the statement is sent to the database server each and every time.
PreparedStatement – the statement is cached and then the execution path is pre-determined on
the database server allowing it to be executed multiple times in an efficient manner.
CallableStatement – used for executing stored procedures on the database.
Update statements such as INSERT, UPDATE and DELETE return an update count that indicates
how many rows were affected in the database. These statements do not return any other
information.
Web browsers receive HTML documents from a web server or from local storage and render the
documents into multimedia web pages. HTML describes the structure of a web page semantically
and originally included cues for the appearance of the document.
HTML elements are the building blocks of HTML pages. With HTML constructs, images and
other objects such as interactive forms may be embedded into the rendered page. HTML provides
a means to create structured documents by denoting structural semantics for text such as headings,
paragraphs, lists, links, quotes and other items. HTML elements are delineated by tags, written
using angle brackets.
Extensible Markup Language (XML) is a markup language that defines a set of rules for
encoding documents in a format that is both human-readable and machine-readable. The W3C's
XML 1.0 Specification and several other related specifications all of them free open standards
define XML.
The design goals of XML emphasize simplicity, generality, and usability across the Internet. It is
a textual data format with strong support via Unicode for different human languages. Although the
design of XML focuses on documents, the language is widely used for the representation of
arbitrary data structures such as those used in web services.
Several schema systems exist to aid in the definition of XML-based languages, while programmers
have developed many application programming interfaces (APIs) to aid the processing of XML
data.
XML is widely used in a Services Oriented Architecture (SOA). Disparate systems communicate
with each other by exchanging XML messages. The message exchange format is standardised as
an XML schema (XSD). This is also referred to as the canonical schema.
Swing is a GUI widget toolkit for Java. It is part of Oracle's Java Foundation Classes (JFC) – an
API for providing a graphical user interface (GUI) for Java programs.
Swing was developed to provide a more sophisticated set of GUI components than the earlier
Abstract Window Toolkit (AWT). Swing provides a look and feel that emulates the look and feel
of several platforms, and also supports a pluggable look and feel that allows applications to have
a look and feel unrelated to the underlying platform. It has more powerful and flexible components
than AWT. In addition to familiar components such as buttons, check boxes and labels, Swing
provides several advanced components such as tabbed panel, scroll panes, trees, tables, and lists.
Unlike AWT components, Swing components are not implemented by platform-specific code.
Instead, they are written entirely in Java and therefore are platform-independent. The term
"lightweight" is used to describe such an element. The Abstract Window Toolkit (AWT) is Java's
original platform-dependent windowing, graphics, and user-interface widget toolkit, preceding
Swing. The AWT is part of the Java Foundation Classes (JFC) — the standard API for providing
a graphical user interface (GUI) for a Java program. AWT is also the GUI toolkit for a number of
Java ME profiles. For example, Connected Device Configuration profiles require Java runtimes
on mobile telephones to support the Abstract Window Toolkit.
JFRAME
A Frame is a top-level window with a title and a border. The size of the frame includes any area
designated for the border. The dimensions of the border area may be obtained using the getInsets
method. Since the border area is included in the overall size of the frame, the border effectively
obscures a portion of the frame, constraining the area available for rendering and/or displaying
subcomponents to the rectangle which has an upper-left corner location of (insets.left, insets.top),
and has a size of width - (insets.left + insets.right) by height - (insets.top + insets.bottom).
JBUTTON
The class JButton is an implementation of a push button. This component has a label and generates
an event when pressed. It can also have an Image.
JTEXTFIELD
JTextField is a fundamental Swing’s component that allows users editing a single line of text. This
article lists common practices when using JTextField in Swing development.
Chapter-5
IMPLEMENTATION
SOURCE CODE:
<!DOCTYPE>
<html>
<head>
<title>Hotel Management</title>
<link rel="stylesheet" type="text/css" href="index.css"/>
<link rel="stylesheet" type="text/css" href="dhtmlxcalendar.css"/>
<script src="dhtmlxcalendar.js"></script>
<style>
#calendar,
#calendar2,
{
border: 1px solid #909090;
font-family: Tahoma;
font-size: 12px;
}
</style>
<script>
var myCalendar;
function doOnLoad()
{
myCalendar = new dhtmlXCalendarObject(["calendar","calendar2",]);
}
</script
</head>
<body onload="doOnLoad();">
<div id="holder"><a href=""><img src="images/22.jpg" width="285px" height="100px"/></a>
<div id="header">
<ul>
<li><a href="login.html">Login</a></li>
<li><a href="overview.html">Overview</a></li>
<li><a href="menu.html">Restaurant</a></li>
<li><a href="book.html">Booking</a></li>
<li><a href="index.html">Home</a></li><br><br><br>
</ul>
<marquee behavior=alternate bgcolor="saddlebrown"><font color=white><font
size="2px"><b><i>WELCOME TO HOTEL PANORAMA
YEHALANKHA,BANGALORE,KARNAT
AKA </i></b></font></marquee>
</div><!--header -->
<br>
<div id="ab">
<div id="check">
<br>
</font> OUR SERVICES:-</font> <br>
<td>
<ul type=square>
</form>
</div><!--fd-->
</div><!--ab-->
<br clear="all"/>
<div id="ac">
<h1>DELUXE</h1>
<div id="a">
<br><br><br><br>
Single Rs.2000
<br>
<a href="images/single.jpg"><input type="submit" value="View"></a>
<a href="book.html"><input type="submit" value="Booking"></a>
</div><!--a-->
<div id="b">
<br><br><br><br>
Double Rs.3000
<br>
<a href="images/2.jpg"><input type="submit" value="View"></a>
<a href="book.html"><input type="submit" value="Booking"></a>
</div><!--b-->
<div id="c">
<br><br><br><br>
Three Rs.5000
<br>
<a href="images/deluxe.jpg"><input type="submit" value="View"></a>
<a href="book.html"><input type="submit" value="Booking"></a>
</div><!--c-->
</div><!--ac-->
<div id="offer">
<h1>BEVERAGES</h1>
<div id="a1"><p> </p><br><br>
<br><br>
<br> <b></b>
</div><!--a1-->
<div id="b1"><p> </p><br>
<br>
<br>
Dept. of ISE 2017-18
Page 14
SMTP MAIL SERVER
<br> <b></b>
</div><!--b1-->
<div id="c1"><p> </p><br>
<br>
<br>
<br> <b></b>
</div><!--c1-->
<br><br>
</div><!--offer-->
<div id="nonac">
<h1>SUITE</h1>
<div id="a2">
<p> </p>
Single Rs.2500
<br>
<a href="images/sdd.jpg"><input type="submit" value="View"></a>
<a href="book.html"><input type="submit" value="Booking"></a>
</div><!--a2-->
<div id="b2">
<p> </p>
Double Rs.2000
<br>
<a href="images/dd.jpg"><input type="submit" value="View"></a>
<a href="book.html"><input type="submit" value="Booking"></a>
</div><!--b2-->
<div id="c2">
Three Rs.3500
<br>
<a href="images/hotel.jpg"><input type="submit" value="View"></a>
<a href="book.html"><input type="submit" value="Booking"></a>
</div><!--c2-->
</div><!--nonac-->
<div id="rest">
<h1>Special Dishes</h1>
<div id="a3">
</div>
<div id="b3">
<a href="#"></a>
</div>
<div id="c3">
</div>
</div><!--rest-->
</div><!--holder -->
</body>
Dept. of ISE 2017-18
Page 15
SMTP MAIL SERVER
</html>
PHP CODE:
Db_connection.php
<?php
$db_host='localhost';
$db_user='root';
$db_pass='';
$db_name='hotel management system';
$mysqli= new mysqli($db_host,$db_user,$db_pass,$db_name);
if($mysqli->connect_error){
printf(" connection failed %s\n",$mysqli->connect_error);
exit();
}
?>
Book.php
<?php
include('db_connection.php');
//$mysqli = NEW MYSQLI('localhost','root','','hotel management system');
$name = $_POST['name'];
$email = $_POST['email'];
$mob = $_POST['mobile'];
$check_in = $_POST['in'];
$check_out = $_POST['out'];
$rm= $_POST['room'];
$sql="INSERT INTO `book`
(`name`,`email`,`mobile_no`,`check_in`,`check_out`,`room`) VALUES
('$name','$email','$mob','$check_in','$check_out','$rm')";
$results= $mysqli->query($sql) or die($mysqli->error.__LINE_);
header('Location:payment.html');
?>
Chapter-6
TESTING
Testing is a process of executing a program with the intent of finding an error. Testing is a crucial
element of software quality assurance and presents ultimate review of specification, design and
coding.
System Testing is an important phase. Testing represents an interesting anomaly for the software.
Thus a series of testing are performed for the proposed system before the system is ready for user
acceptance testing.
A good test case is one that has a high probability of finding an as undiscovered error. A successful
test is one that uncovers an as undiscovered error.
Chapter-7
CONCLUSION
The package was designed in such a way that future modifications can be done easily. The
following conclusions such can be deduced from the development of the project.
REFERENCE
The following books were referred during the analysis and execution phase of the project
Appendix
SNAPSHOTS