You are on page 1of 52

INDEX

S NO CONTENTS
1. COMPANY PROFILE

2. OBJECTIVE OF PROJECT

3. INTRODUCTION TO PAYING GUEST PORTAL

4. INTRODUCTION TO TECHNOLOGY USED

5. FRONTEND OF PROJECT

 JAVA

 JSP

 SERVLETS

 HTML

 CSS

6. BACKEND OF PROJECT

 MY SQL

 SERVERS

7. HARDWARE AND SOFTWARE REQUIREMENTS

8. SCREENSHOTS

 USER INTERFACE

 DATABASE TABLE VIEW

9. FUTURE SCOPE & CONCLUSION

10. BIBLOGRAPHY
TRAINING ORGANIZATION PROFILE

1.1 ABOUT

INDIAN INSTITUTE OF HARDWARE TECHNOLOGY PVT. LTD(IIHT), compliant

company, has now emerged into providing practical training on various software

technologies under the banner of IIHT.IIHT focuses on strategic and practical approach

in providing training to students and working professionals. IIHT Technical Education

Services Pvt. Ltd is specifically dedicated to training of software testing courses backed

by Industry experts to solve real-time technical challenges.Under the close guidance

and supervision of our experienced professionals, you will be trained on various

technical aspects to tackle industry challenges faced regularly in your professional life.
IIHT provides teams of dedicated software engineers who know how to satisfy client

testing requirements with efficient management skills and software product

engineering methodologies:

 We overcome the challenges of sketchy specifications, 48-hour turnarounds and

complicated end-user software needs.

 We maximize the benefits of each offshore team by breaking the communication,

cultural and time-difference barriers.

 We overcome the challenges of working with an offshore team and delivering a

quality application while meeting time-to-market demands.

 We have nearly a decade of experience in streamlining our offshore software

product engineering practice.

 We are adaptable to our customers´ needs.

 We are an certified company, so we focus on international-standard quality,

strict adherence to deadlines and total client/partner satisfaction.

bebo Technologies has grown 20% - 50% per year since its founding, completing

hundreds of successful engagements for clients such as Adobe, IBM, Oracle, Cisco,

Prudential, Mass Mutual, Luxotica, Ford, and host of startup companies in Silicon Valley.

1.2 APPROACH

IIHT has built a team of seasoned professionals who know how to break the technology

barriers and deploy high-capability software practices, resulting in the best quality

software applications and projects.

We have implemented an offshore model that gives our clients a competitive advantage

and improved return on their investment. In our hybrid model, we couple offshore

teams with local management, thus bridging the communication gap that can otherwise
complicate working across two different cultures. We provide the necessary resources

every step of the way to ensure success, whether it is by providing a complete end-to-

end product development team or augmenting an existing IT support engineering team.

1.3 VALUES & CULTURE

Our mission is to provide companies with comprehensive outsourcing software

solutions. Our goal is to optimize our client´s software efforts while meeting their

objectives and schedules.

1.4 QUALITY

To accomplish this mission, we have built a team of expert engineers who know how to

go beyond the checklist to deploy high-capability practices resulting in high-quality

software releases and maintenance, time after time. We also have developed an offshore

/ on-site model that gives our clients a competitive advantage and improved return on

their investment.

1.5 DEDICATION

IIHT is dedicated to providing high-caliber offshore software product engineering

services overseen by a local management team with a proven record of success. This

dynamic partnership of offshore technical talent and local management provides cost-

effective software solutions while avoiding the risks that often accompany a remote

software services team.


1.6 FLEXIBILITY

IIHT is very flexible in adapting to your environment. We understand the urgency of

performing the software services you need in the time that you have. Our staff of

professionals can take your project from the initial design phase to completion, by

providing the necessary resources every step of the way toward success. Our

outsourcing software services include Software Development and QA, Professional

Services, IT Management and Product Support.

TECHNOLOGIES @ IIHT

 Comprehensive QA Solutions

 Application Support Services

 Java Development

 iPhone / Android Framework

 Perl Development

 Sustenance Engineering

 Dot Net Technologies

2. TRAINING:-

The business of IIHT is characterized by advanced technologies both in the field of

Educational services and IT. Technology is advancing very fast and with a view to keep

updated with the latest technology .IIHT undertakes training activities either through its

own resources or through external agencies. IIHT is having strategic tie-up with

QASource based in U.S.A. and act as a parent company.


In Information Technology' IIHT has established its IT Training Centre BTES which is

running various courses duly approved by Department of Electronics, Govt. of India for

career advancement.
OBJECTIVES OF PROJECT

 The main purpose of project is to provide ease for finding the rooms,apartments

and lodgments in any city through one portal or website.This reduce the need for

searching the houses in the City.

 Availability check and instant confirmations eliminate email exchanges between

guests and your reservations department. Valuable reservations staff time is

saved because reservation requests will no longer have to be processed.

 Guests can check availability and get the address of vacant rooms in city.This can

make the life of people much easy as there is no need to worry about the

accommodation at new place .

 Also the portal is User and Admin accessible .A user needs to login at the portal

to see all the available rooms in the city with detailed information about it

including address, rent,available facilities,security etc etc and Admin on the

otherhand can update portal time to time according to the booking of the room.
INTRODUCTION TO PROJECT

This project is based with vision to avail online facility to the people those are more

often in the search of a good place to stay.Under this project we made avail all the good

places to live, on our website ,so that a person need not to travel in the city here and

there to find a good place.

The main purpose of project is to provide ease for finding the rooms,apartments and

lodgments in any city through one portal or website.

This reduce the need for searching the houses in the City. Availability check and instant

confirmations eliminate email exchanges between guests and your reservations

department.

Valuable reservations staff time is saved because reservation requests will no longer

have to be processed.

Guests can check availability and book instantly, thus closing a booking without having

to wait for your reservations staff to confirm the reservation by email.

Our Website provide all the above facilities for cities Chandigarh and Jalandhar .We

named our website or portal as Tolet-Bay.

Tolet-Bay provide all the details regarding the facilities provided by the vacant room in

the particular area and all the rent details also.


A person needs to Login to portal to see all the rooms available in the cities,otherwise

one cant see the available rooms.We use JSP and Java JDBC for connectivity with the

MySql Database.

Core Java basics play important in our Project as it helps to make base of our Project as

Java was designed to meet the real-world requirement of creating interactive

networked programs.

The Webpages of Tolet-Bay is made using HTML(Hyper Text MarkUp Language)as it is

main language for creating web pages and informations that can be displayed in a web

browser and the designing is done by using CSS(Cascading Style Sheet)as it defines how

define how HTML tags are displayed or formatted in the browser.

For Database purposes we use MySql software for cresting tables and use

SQL(Structured Query Language) commands to fetch and retrieve data from database as

it is a is a computer language for storing, manipulating and retrieving data stored in

relational database.
INTRODUCTION TO TECHNOLOGY USED

FRONT END

JAVA:

Java programming language was originally developed by Sun Microsystems, which was

initiated by James Gosling and released in 1995 as core component of Sun Microsystems’s

Java platform (Java 1.0 [J2SE]). As of December 08 the latest release of the Java Standard

Edition is 6 (J2SE). With the advancement of Java and its wide spread popularity, multiple

configurations were built to suite various types of platforms. Ex: J2EE for Enterprise

Applications, J2ME for Mobile Applications. Sun Microsystems has renamed the new J2

versions as Java SE, Java EE and Java ME respectively. Java is:

Object Oriented: In java everything is an Object. Java can be easily extended since it is

based on the Object model. Although in􀀲uenced by its predecessors, Java was not

designed to be source-code compatible with any other language. This allowed the Java

team the freedom to design with a blank slate. One outcome of this was aclean, usable,

pragmatic approach to objects. Borrowingliberally from many seminal object-software

environments of the last few decades, Java manages tostrike a balance between the

purist’s “everything is anobject” paradigm and the pragmatist’s “stay out of my

way” model. The object model in Java is simple andeasy to extend, while primitive types,

such as integers,are kept as high-performance nonobjects.

Platform independent: Unlike many other programming languages including C and C++

when Java is compiled, it is not compiled into platform specific machine, rather into
platform independent byte code. This byte code is distributed over the web and

interpreted by virtual Machine (JVM) on whichever platform it is being run.

Simple: Java is designed to be easy to learn. If you understand the basic concept of OOP

java would be easy to master. Java was designed to be easy for the professional

programmer to learn and use e􀀲ectively. Assuming that you have some programming

experience, you will not and Java hard to master. If you already understand the

basic concepts of object-oriented programming, learning Java will be even easier. Best

of all, if you are an experienced C++ programmer, moving to Java will require very little

e􀀲ort. Because Java inherits theC/C++ syntax and many of the object-oriented features

of C++, most programmers have little trouble learning Java.

Secure: With Java's secure feature it enables to develop virus-free, tamper-free systems.

Authentication techniques are based on public-key encryption.

Architectural- neutral: Java compiler generates an architecture-neutral object file format

which makes the compiled code to be executable on many processors, with the presence

Java runtime system.

Portable: Being architectural neutral and having no implementation dependent aspects

of the specification makes Java portable. Compiler and Java is written in ANSI C with a

clean portability boundary which is a POSIX subset. Portability is a major aspect of the

Internet because there are many di􀀲erent types of computers and operating systems

connected to it. If a Java program were to be run on virtually any computer connected to
the Internet, there needed to be some way to enable that program to execute on

di􀀲erent systems. For example, in the case of an applet, the same applet must be able to

be downloaded and executed by the wide variety of CPUs, operating systems, and

browsers connected to the Internet. It is not practical to have di􀀲erent versions of

the applet for di􀀲erent computers. The same code must work on all computers.

Therefore, some means of generating portable executable code was needed. As you

will soon see, the same mechanism that helps ensure security also helps create

portability.

Robust: Java makes an effort to eliminate error prone situations by emphasizing mainly

on compile time error checking and runtime checking. The multiplatformeenvironment

of the Web places extraordinary demands on a program, because the program must

execute reliably in a variety of systems. Thus, the ability to create robust programs was

given a high priority in the design of Java. To gain reliability, Java restricts you in a few

key areas to force you to 􀀲nd your mistakes early in program development. At the

same time, Java frees you from having to worry about many of the most common causes

of programming errors. Because Java is a strictly typed language, it checks your code at

compile time. However, it also checks yourcode at run time. Many hard-to-track-down

bugs that often turn up in hard-to-reproduce run-time situationsare simply impossible

to create in Java. Knowing that what you have written will behave in a predictable way

under diverse conditions is a key feature of Java.

(In fact, deallocation is completely automatic, because Java provides garbage collection

for unused objects.) Exceptional conditions in traditional environments often arise in

situations such as division by zero or “􀀲le not found,” and they must be managed with

clumsy and hard-to-read constructs. Java helps in this area by providing object-oriented
exception handling. In a wellwritten Java program, all run-time errors can—anshould—

be managed by your program.

Multi-threaded: With Java's multi-threaded feature it is possible to write programs

that can do many tasks simultaneously. This design feature allows developers construct

smoothly running interactive applications. Java was designed to meet the real-world

requirement of creating interactive, networked programs. To accomplish this, Java

supports multithreaded programming, which allows you to write programs that do

many things simultaneously. The Java run-time system comes with an elegant yet

sophisticated solution for multiprocess synchronization that enables you to construct

smoothly running interactive systems. Java’s easy-to-use approach to multithreading

allows you to think about the speci􀀲c behavior of your program, not the multitasking

subsystem.

Interpreted: Java byte code is translated on the fly to native machine instructions and

is not stored anywhere. The development process is more rapid and analytical since the

linking is an incremental and light weight process. As described earlier, Java enables the

creation of crossplatform programs by compiling into an intermediate representation

called Java bytecode. This code can be executed on any system that implements the Java

Virtual Machine. Most previous attempts at cross-platform solutions have done so at the

expense of performance. As explained earlier, the Java bytecode was carefully designed

so that it would be easy to translate directlyinto native machine code for very high

performance by using a just-in-time compiler. Java run-time systems that provide this

feature lose none of the bene􀀲ts of the platform-independent code.


High Performance: With the use of Just-In-Time compilers Java enables high performance.

Distributed: Java is designed for the distributed environment of the internet. Java is

designed for the distributed environment of the Internet because it handles TCP/IP

protocols. In fact, accessing a resource using a URL is not much di􀀲erent from accessing

a 􀀲le. Java also supports Remote Method Invocation (RMI). This feature enables a

program toinvoke methods across a network.

Dynamic: Java is considered to be more dynamic than C or C++ since it is designed to

adapt to an evolving environment. Java programs can carry extensive amount of run-

time information that can be used to verify and resolve accesses to objects on run-time.

Java programs carry with them substantial amounts of run-time type information that is

used to verify and resolve accesses to objects at run time. This makes it possible to

dynamically link code in a safe and expedient manner. This is crucial to the robustness

of the Java environment, in which small fragments of bytecode may be dynamically

updated on a running system.

History of Java

James Gosling initiated the Java language project in June 1991 for use in one of his many

set-top box projects. The language, initially called Oak after an oak tree that stood

outside Gosling's office, also went by the name Green and ended up later renamed as

Java, from a list of random words. Sun released the first public implementation as Java

1.0 in 1995. It promised Write Once, Run Anywhere (WORA), providing no-cost run-

times on popular platforms. On 13 November 2006, Sun released much of Java as free
and open source software under the terms of the GNU General Public License (GPL). On

8 May 2007 Sun finished the process, making all of Java's core code free and open-

source, aside from a small portion of code to which Sun did not hold the copyright. Java

was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike

Sheridan at Sun Microsystems, Inc. in 1991. It took 18 months to develop the 􀀲rst

working version. This language was initially called “Oak,” but was renamed “Java” in

1995. Between the initial implementation of Oak in the fall of 1992 and

the public announcement of Java in the spring of 1995, many more people contributed

to the design and evolution of the language. Bill Joy, Arthur van Ho􀀲, Jonathan Payne,

Frank Yellin, and Tim Lindholm were key contributors to the maturing of the original

prototype.

Popular Java Editors:


To write your java programs you will need a text editor. There are even more

sophisticated IDE available in the market. But for now, you can consider one of the

following:

 Notepad: On Windows machine you can use any simple text editor like Notepad

(Recommended for this tutorial), Text Pad.

 Net beans: is a Java IDE that is open source and free which can be downloaded

fromhttp://www.netbeans.org/index.html.

 Eclipse: is also a java IDE developed by the eclipse open source community and can

be downloaded from http://www.eclipse.org/

Let us look at a simple code that would print the words Hello World.

public class MyFirstJavaProgram {


/* This is my first java program.

* This will print 'Hello World' as the output

public static void main(String []args) {

System.out.println("Hello World"); // prints Hello World

}}

Lets look at how to save the file, compile and run the program. Please follow the steps

given below:

 Open notepad and add the code as above.

 Save the file as: MyFirstJavaProgram.java.

 Open a command prompt window and go o the directory where you saved the class.

Assume its C:\.

 Type ' javac MyFirstJavaProgram.java ' and press enter to compile your code. If

there are no errors in your code the command prompt will take you to the next line.(

Assumption : The path variable is set).

 Now type ' java MyFirstJavaProgram ' to run your program.

 You will be able to see ' Hello World ' printed on the window.

C :>javac MyFirstJavaProgram.java

C :> java MyFirstJavaProgram

Hello World
 Basic Syntax: About Java programs, it is very important to keep in mind the

following points. Case Sensitivity - Java is case sensitive which means identifier

Hello and hello would have different meaning in Java.

 Class Names - For all class names the first letter should be in Upper Case. If

several words are used to form a name of the class each inner words first letter

should be in Upper Case. Example class MyFirstJavaClass.

 Method Names - All method names should start with a Lower Case letter. If

several words are used to form the name of the method, then each inner word's

first letter should be in Upper Case. Example public void myMethodName(),

 Program File Name - Name of the program file should exactly match the class

name. When saving the file you should save it using the class name (Remember

java is case sensitive) and append '.java' to the end of the name. (if the file name

and the class name do not match your program will not compile). Example :

Assume 'MyFirstJavaProgram' is the class name. Then the file should be saved

as'MyFirstJavaProgram.java' „h public static void main(String args[]) .

JSP (JAVA SERVER PAGES)


JSP (Java Server Pages) is a standard for developing interactive Web applications (pages

containing dynamic content). A JSP web page (recognizable by the .jsp extension) may

display different content based on certain parameters (information stored in a database,

the user preferences, ..), while a classic webpage (with the .htm or .html extension) will

continuously display the same information.JSP is actually a powerful scripting language

(interpreted language) executed on the server side (like CGI, PHP, ASP, ...) and not on the

client side (unlike scripts written in JavaScript or Java applets which run in the browser of

the user connected to a site).JSPs are integrated in a web page in HTML using special tags

which will notify the Web server that the code included within these tags are to be

interpreted. The result (HTML codes) will be returned to the client browser .Java Server

Pages are part of a 3-tier architecture: where a server supporting the Java Server Pages

(generally referred to as application server) will act as a mediatior between the client

browser and a database (generally referred to as data server). JSP provides the necessary

elements for the connection to the database management system and allow the

manipulation of data through SQL.

A JavaServer Pages component is a type of Java servlet that is designed to fulfill the role

of a user interface for a Java web application. Web developers write JSPs as text files

that combine HTML or XHTML code, XML elements, and embedded JSP actions and

commands.

Using JSP, you can collect input from users through web page forms, present records

from a database or another source, and create web pages dynamically.


JSP tags can be used for a variety of purposes, such as retrieving information from a

database or registering user preferences, accessing JavaBeans components, passing

control between pages and sharing information between requests, pages etc.

WHY USE JSP?

JavaServer Pages often serve the same purpose as programs implemented using the

Common Gateway Interface (CGI). But JSP offer several advantages in comparison with

the CGI.

 Performance is significantly better because JSP allows embedding Dynamic

Elements in HTML Pages itself instead of having a separate CGI files.

 JSP are always compiled before it's processed by the server unlike CGI/Perl

which requires the server to load an interpreter and the target script each time

the page is requested.

 Java Server Pages are built on top of the Java Servlets API, so like Servlets, JSP

also has access to all the powerful Enterprise Java APIs, including JDBC, JNDI,

EJB, JAXP etc.

 JSP pages can be used in combination with servlets that handle the business

logic, the model supported by Java servlet template engines.

Finally, JSP is an integral part of Java EE, a complete platform for enterprise class

applications. This means that JSP can play a part in the simplest applications to

the most complex and demanding.

JQuery:-JQuery is a lightweight, "write less, do more", JavaScript library. The purpose of

jQuery is to make it much easier to use JavaScript on your website.jQuery takes a lot of
common tasks that require many lines of JavaScript code to accomplish, jQuery simplifies

HTML document traversing, event handling, animating, and Ajax interactions for rapid web

development and wraps them into methods that you can call with a single line of

code.jQuery also simplifies a lot of the complicated things from JavaScript, like AJAX calls

and DOM manipulation. The jQuery library contains the following features:

 HTML/DOM manipulation

 CSS manipulation

 HTML event methods

 Effects and animations

 AJAX

 Utilities

INTRODUCING TO JAVASCRIPT

JavaScript is the world's most popular programming language. A scripting language is

a lightweight programming language. JavaScript is programming code that can be

inserted into HTML pages. JavaScript inserted into HTML pages, can be executed by all

modern web browsers. JavaScript is easy to learn. JavaScript is the most popular

scripting language on the internet, and works in all major browsers, such as Internet

Explorer, Firefox, Chrome, Javascript is a dynamic computer programming language. It

is lightweight and most commonly used as a part of web pages, whose

implementations Opera, and Safari. JavaScript was designed to add interactivity to

HTML pages before you start this lesson you should already know HTML. It's important

to understand the difference between Java and JavaScript. Java is a full programming

language developed by Sun Microsystems with formal structures, etc. Most JavaScript
must be written in the HTML document between <SCRIPT> tags. You open with a

<SCRIPT> tag, write your JavaScript, and write a closing </SCRIPT> tag. allow client-

side script to interact with the user and make dynamic pages. It is an interpreted

programming language with object-oriented capabilities.

JavaScript was first known as LiveScript, but Netscape changed its name to JavaScript,

possibly because of the excitement being generated by Java. JavaScript made its first

appearance in Netscape 2.0 in 1995 with the nameLiveScript. The general-purpose

core of the language has been embedded in Netscape, Internet Explorer, and other web

browsers.

The ECMA-262 Specification defined a standard version of the core JavaScript

language.

 JavaScript is a lightweight, interpreted programming language.

 Designed for creating network-centric applications.

 Complementary to and integrated with Java.

 Complementary to and integrated with HTML.

 Open and cross-platform


SERVLET:-

Servlets are most often used to [citation needed]. Process or store data that was

submitted from an HTML form Provide dynamic content such as the results of a

database query. Manage state information that does not exist in the stateless HTTP

protocol, such as filling the articles into the shopping cart of the appropriate customer.

Technically speaking, a "servlet" is a Java class in Java EE that conforms to the Java

Servlet API, a standard for implementing Java classes which respond to requests.

Servlets could in principle communicate over any client–server protocol, but they are

most often used with the HTTP protocol. 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. 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. A Servlet is an object that receives a request and

generates a response based on that request. The basic Servlet package defines Java

objects to represent servlet requests and responses, as well as objects to reflect the

servlet's configuration parameters and execution environment. The package

javax.servlet.http defines HTTP-specific subclasses of the generic servlet elements,

including session management objects that track multiple requests and responses

between the web server and a client. Servlets may be packaged in a WAR file as a web

application. Servlets can be generated automatically from Java Server Pages (JSP) by the

JavaServer Pages compiler. The difference between servlets and JSP is that servlets
typically embed HTML inside Java code, while JSPs embed Java code in HTML. While the

direct usage of servlets to generate HTML (as shown in the example below) has become

rare, the higher level MVC web framework in Java EE (JSF) still explicitly uses the servlet

technology for the low level request/response handling via the Faces Servlet. A

somewhat older usage is to use servlets in conjunction with JSPs in a pattern called

"Model 2", which is a flavor of the model–view–controller pattern. The current version

of Servlet is 3.1. Servlet can be described in many ways, depending on the context.

 Servlet is a technology i.e. used to create web application.

 Servlet is an API that provides many interfaces and classes including

documentations.

 Servlet is an interface that must be implemented for creating any servlet.

 Servlet is a class that extend the capabilities of the servers and respond to the

incoming request. It can respond to any type of requests.

 Servlet is a web component that is deployed on the server to create dynamic web

page.
INTRODUCTION TO OPEN SOURCE:-

Open source describes practices in production and development that promote access to

the end product's source materials. Some consider open source a philosophy, others

consider it a pragmatic methodology. Before the term open source became widely

adopted, developers and producers used a variety of phrases to describe the concept;

open source gained hold with the rise of the Internet, and the attendant need for massive

retooling of the computing source code. Opening the source code enabled a self-

enhancing diversity of production models, communication paths, and interactive

communities. Before the term open source became widely adopted, developers and

producers used a variety of phrases to describe the concept; open source gained hold

with the rise of the Internet, and the attendant need for massive retooling of the

computing source code. Opening the source code enabled a self-enhancing diversity of

production models, communication paths, and interactive communities.


CONNECTING TO SERVER

GLASSFISH:-GlassFish is an open-source application server project started by Sun

Microsystems for the Java EE platform and now sponsored by Oracle

e Corporation. The supported version is called Oracle GlassFish Server. GlassFish is free

software, dual-licensed under two free software licences: the Common Development

and Distribution License (CDDL) and the GNU General Public License (GPL) with the

classpath exception.

APACHE TOMCAT:-Apache Tomcat (or simply Tomcat, formerly also Jakarta Tomcat) is

an open source web server and servlet container developed by the Apache Software

Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP)

specifications from Sun Microsystems, and provides a "pure Java" HTTP web server

environment for Java code to run in. In the simplest config Tomcat runs in a single

operating system process. The process runs a Java virtual machine (JVM). Every single

HTTP request from a browser to Tomcat is processed in the Tomcat process in a

separate thread

QUERYING THE DATABASE

Now that you have some data in the database, you probably want to retrieve it. You use

the SELECT statement to choose data that fits your criteria. Typical syntax for this

command is as follow:

SELECT [fieldnames]

AS [alias]

FROM [tablename]

WHERE [criteria]

ORDER BY [fieldname to sort on] [DESC]


LIMIT [offset, maxrows]

You can set numerous other parameters, but these are the most commonly used:

? SELECT [fieldnames]: First decide what specific fieldnames you want to retrieve; if you

want to see them all, you simply insert *.

? AS: You use the alias to group two or more fieldnames together so that you can

reference them later as one giant variable. An example would be:

SELECT first_name, last_name AS full_name. . . ORDER BY full_name . . .

You cannot use the AS parameter with the WHERE parameter, because this is a

limitation of MySQL.When the WHERE clause is executed, the column value may not be

known.

? FROM: This is pretty self-explanatory: You just need to name the table or tables you

are pullingthe data from.

? WHERE: List your criteria for filtering out the data, as described in the following

section.

? ORDER BY: Use this parameter if you want the data sorted on a particular field; if you

want theresults returned in descending order, add DESC.

? LIMIT: This enables you to limit the number of results returned and offset the first

record returned to whatever number you choose. An example would be: LIMIT 9, 10

This would show records 10 through 19. This is a useful feature for showing only a

certain number of records on a page, and then allowing the user to click a “next page”

link to see more.

WHERE: The beast clause called WHERE deserves its own little section because it’s

really the meat of the query.

Using PHP5 with MySQL


SELECT * FROM customers

//retrieves all information about all customers

SELECT * FROM customers WHERE gender = “Male”

//retrieves all information about male customers

Let’s look at the WHERE clause a little more in-depth:

? Comparison operators are the heart of the WHERE clause, and they include the

following:

? =, <, >, <=, >=, !=

? LIKE and %: Oh how we like LIKE. LIKE lets you compare a piece of text or number and

gives you the % as a wildcard.

Example:

SELECT * FROM products WHERE description LIKE “%shirt%”

This gives you any records that have the word or text pattern of “shirt” in the

description, such as “t-shirt,” “blue shirts,” or “no shirts here.” Without the %s you

would get only those products that have a description of “shirt” and nothing else.

FORM

JAVA uses a set of simple yet powerful expressions that, once combined, provide you

with the means to do virtually anything you want. In this chapter, you begin to build a

simple application that allows you to add, edit, or delete members of a data set (in this

instance, movies, actors, and directors). This chapter welcomes you into a world of

JAVA/MySQL interaction by covering the following:


? Creating forms using buttons, text boxes, and other form elements

? Creating JSP scripts to process HTML forms

? Mastering $_POST and $_GET to retrieve data

? Passing hidden information to the form processing script via hidden form controls and

URL query string

Working with Form

As a wise man once said, every journey starts with a single step. To start this particular

journey, you will focus on a very simple form. It will include only a text field and a

submit button in a table layout. The processing script will display only the value entered

in the text field. Try It Out Say My Name In this part, you are going to get JAVA to

respond to a name entered in a form. This is a simple variation of the typical “hello

world” program, allowing you to take your first step into interactivity. This is a simple

variation of the typical “hello world” program, allowing you to take your first step into

interactivity.

<Form method=”POST” action=”java.jsp”><fieldset><legend>

Student Registration</legend><table border="0" cellspacing="8"

cellpadding="5"><tr><td>Student Id:</td<td><input type="number"

required="required" name="tid" value="" required="required"/></td>

</tr><tr><td>password:</td><td><input type="password" required="required"

name="tpassword" value="" required="required"/></td></tr><tr><input

type="submit" value="Register" name="btnRegister"/></tr>

</Form>
HOW IT WORKS

As with any recipe, it’s a good idea to start working on forms by understanding the

ingredients. To familiarize yourself with forms, you’ll need some background

information about HTML form elements and a few new JAVA functions. Let’s start with

the HTML form itself.

FORM ELEMENT

First, we’ll introduce the first HTML element you’ll need: FORM. It delimits the form

area in the page and holds the fields you want your Web site users to fill in.

<form action=”formprocess1.php” method=”post”>

<!--form controls here-->

</form>

Notice that the FORM element has an ending tag and two attributes. The first attribute

(action) is the recipient page address (the form processing script).


INTRODUCTION TO HTML

A markup language is a modern system for annotating a document in a way that is

syntactically distinguishable from the text. See example as indicated below:

The blue text shown in an example for Markup to indicate the content enclosed in it.

HTML or Hyper Text Markup Language is the main markup language for creating web

pages and informations that can be displayed in a web browser. It is a markup language

that web browsers use to interpret and compose text, images and other elements into

visual or audible web pages. Now it is simple. Isn't it? We may summarize the

knowledge of HTML as below

 HTML stands for Hyper Text Markup Language

 HTML is a markup language


 A markup language is a set of markup tags

 The tags describe document content

 HTML documents contain HTML tags and plain text

 HTML documents are also called web pages

A HTML document when composed of the markup elements is saved as a file with

extension “.html” or “.htm”. The rendering of the document is done on any web browser

such as Internet Explorer, Google Chrome, etc.,.

HTML Elements HTML is written in the form of HTML elements consisting of tags

enclosed in angle brackets (like <html>). HTML tags most commonly come in pairs like

<h1> and </h1>, although some tags represent empty elements and so are unpaired, for

example <img>. The first tag in a pair is the start

tag, and the second tag is the end tag (they are also called opening tags and closing tags

respectively). In between these tags web designers can add text, tags, comments and

other types of text-based content. Most HTML elements have attributes. The browser

does not display the HTML tags, but uses the tags to interpret the content of the page.

The purpose of a web browser is to read HTML documents and compose them into

visible web pages.

HTML Images In HTML, images are defined with the <img> tag. The <img> tag is empty,

which mean it contains only the attributes and no closing tag. Some of the attributes of

the image tag are:

1. src – Indicates the source or the URL of the image that is to be displayed

2.alt – alternate name or text for the image( tooltip)


3.height, width – attributes describing the size

HTML LIST HTML List is of three types. unordered list <UL> (ie., unnumbered/bullets)

,ordered (ie., numbered) list <OL> and definition <DL> (I.e define the terms like in

glossary).These elements are block elements. Unordered Lists: An unordered list is

typically a bulleted list of items. This is probably the most common type of list on the

Web. The <ul> tag is opening an unordered list and </ul> is closing tag. Between these

tags are placed list items with <li> tag as shown in the below example. The type

attribute determines the form of bullet which precedes the list. Allowed values are disc,

square, circle.

Output

1. Red

2. Yellow

3. Blue
Ordered Lists: An ordered list is formatted exactly the same as an unordered list,

except that <OL> tags are used instead of <UL>. In an ordered list, sequential numbers

are generated automatically, as shown in the below example.

The type attribute determines the sequencing number precedes the list . Valid values

are 1, a, A, i, I.

HTML Links The HTML <a> tag defines a hyperlink.

A hyperlink (or link) is a word, group of words, or image that you click on to navigate to

another document.

When you move the cursor hover a link in a Web page, the cursor looks like pointed-

hand instead of usual arrow . The most important attribute of the <a> element is the

href attribute, which indicates the link's destination.


HTML FORMS HTML Forms are required when you want to collect some data from the

user and process it. For example registration information: Name, address, date of birth,

contact number, mail-id etc

The <form> tag is used to create HTML form: A form will take input from the user using

different form controls and then the input/data is passed to server for processing.

 Users interact with forms through “form controls”.

 Each control has both an initial value and a current value.

 A control's initial value is specified using ”value” attribute.

 The control's current value is first set to the initial value. Thereafter, the

control's current value may be modified through user interaction and scripts.

 A control's initial value does not change. Thus, when a form is reset, each

control's current value is reset to its initial value.

HTML defines the following control types:

Button HTML provide three types of buttons:

1. Submit button: Users click the submit button to process data after filling out a form.

The submit button uses the input element with a type attribute of either submit or

image. The submit attribute value is the most common as it is simple to use and

provides the most control. The image attribute value is used specifically to set an image

as a submit button, however with the use of CSS the need to use an image has greatly

diminished.
To determine the verbiage to be used within the button, the value attribute is used.

Using CSS properties such as background, border-radius, box-shadow, and others, the

button is styled to any specific desire.

2.Reset button: When clicked, a reset button reset all controls to their initial values.

<input type=”reset” value=”reset”> is used to create reset button

3. Push button: Push button have no default behavior. Each push button may have

scripts associated with the element's events attributes. When an event occurs (e.g., the

user clicks the button, release it, etc.), the associated script is executed. e.g:<button

name=”edit” value=”edit”> is used to create button.


INTRODUCTION TO CSS

CSS (Cascading Style Sheets) define how HTML tags are displayed or formatted in the

browser. Styles can be applied to HTML tags to format the look and feel. By defining CSS

based styling, the styling/formatting code can be separated from HTML code. Styles are

normally defined in an external file called style sheets which has “.css” extension. The

stylesheets are then imported into the HTML file. CSS works by defining rules how a

selector (HTML tag) can be displayed.

CSS Syntax

A CSS rule set consists of a selector and a declaration block. The general syntax of a CSS

rule set looks like this:

Selector {property:value; property:value; . . .}

Selector – points to the HTML element that needs to be formatted

Property – points to the specific HTML element's attribute that is being formatted Value

– style values given to the property that is used for formatting

More than one property/value of the HTML element can be specified in the CSS rule set.

The different sets of properties/value pairs are separated by a semi-colon. To improve

the readability the property:value pairs can be written on separate lines. p{color:blue;

text-align:left;}

The rule set above formats the color of the text to blue inside a HTML <p> tag and aligns

the text to left. p { color:red; font-style:italic; font-family:”arial”; }


he rule set above formatted the color of text to red inside a HTML <p> tag, and formats

the text to italics and sets to Arial font.

Grouping Selectors In style sheets there are often elements with same styling. To

minimize code the selectors can be grouped. To group selectors, separate each selector

with a comma.

Class selector The class selector uses “class” attribute of the HTML tag to find the

HTML elements. Unlike “id” selector “class” is generally not given a unique value. Thus

the “class” attribute can be used to apply styling to more than one HTML element that

have the same value for the class attribute. In order to use the class selector, first the

HTML element is given a class name. The name of the class can be a character, string or

a combination of characters and numbers. The class name cannot start with a number.

Then to find the element using the class name write a period character followedby the

class name.

Element selector The element selector selects HTML elements based on the element

tag. When styling is applied based on the element name, all elements that have the same

name will be applied with the same styling. p { text-align: center; color: red; }
For example the rule set above will format all the <p> elements in the HTML document

with the styling mentioned in the rule set.


BACKEND

INTRODUCTION TO MYSQL:-
MySQL is a relational database management system (RDBMS)that runs as a server

providing multi-user access to a number of databases. The MySQL development project

has made its source code available under the terms of the GNU General Public License,

as well as under a variety of proprietary agreements. MySQL was owned and sponsored

by a single for-profit firm, the Swedish company MySQL AB, now owned by Oracle

Corporation.MYSQL is the most popular Open Source Relational SQL database

management system. MYSQL is one of the best RDBMS being used for developing web

based software applications. MYSQL database application should be installed on your

web server. MYSQL is very popular so you will have no problem in finding a web host

that offers MYSQL. Most web host also offer a (GUI) Graphical user interface application

such as PHP My Admin for working with MYSQL databases. The MySQL development

project has made its source code available under the terms of the GNU General Public

License, as well as under a variety of proprietary agreements. MySQL was owned and

sponsored by a single for-profit firm, the Swedish company MySQL AB, now owned by

Oracle Corporation.

 MySQL is released under an open-source license. So you have nothing to pay to

use it.

 MySQL is a very powerful program in its own right. It handles a large subset of

the functionality of the most expensive and powerful database packages.

 MySQL uses a standard form of the well-known SQL data language.

 MySQL works very quickly and works well even with large data sets.
 MySQL is very friendly to PHP, the most appreciated language for web

development.

 MySQL supports large databases, up to 50 million rows or more in a table. The

default file size limit for a table is 4GB, but you can increase this (if your

operating system can handle it) to a theoretical limit of 8 million terabytes (TB).

Here is a simple example to connect to MySQL server from command

prompt:

[root@host]# mysql -u root -p

Enter password:******

This will give you mysql> command prompt where you will be able to execute

any SQL command. Following is the result of above command:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 2854760 to server version: 5.0.9

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

In above example, we have used root as a user but you can use any other user.

Any user will be able to perform all the SQL operations, which are allowed to

that user.

You can disconnect from MySQL database any time using exit command at.
SQL SERVER:

SQL Server is an SQL-compliant RDBMS. SQL-compliant means it use the ANSI

(American National Standard Institute) version of Structured Query Language or ‘SQL’.

Structured Query Language is a command that allow us to modify or retrieve

information from the database.Client server means that SQL Server is designed to store

data in the central location (the server) and deliver it on demand to numerous other

locations (the client). SQL Server is also a Relational Database Management System

(RDBMS).

FEATURES OF SQL SERVER 2005

 Information representation

 Unique definition of rows

 Systematic treatment of Null values

 Guaranteed access

 High level Update, Insert, and Delete

 Retrieving information from the database.

 Accepting query language statements.

 Enforcing security specifications.


INTRODUCTION OF WAMPSERVER

WAMP is a form of mini-server that can run on almost any Windows Operating System.

WAMP includes Apache 2, PHP 5 (SMTP ports are disabled), and MySQL (phpMyAdmin

and SQLite manager are installed to manage your databases) preinstalled.

An icon on the taskbar tray displays the status of WAMP, letting you know if; a) WAMP is

running but no services are opened (the icon will appear red), b) WAMP is running and

one service is opened (the icon will appear yellow) or c) WAMP is running with all

services opened (the icon will appear white). Apache and MySQL are considered to be

services (they can be disabled by left-clicking on the taskbar icon, guiding your cursor

over the service you wish to disable and selecting "Stop Service").WAMPs are packages

of independently-created programs installed on computers that use a Microsoft

Windows operating system.

WAMP is an acronym formed from the initials of the operating system Microsoft

Windows and the principal components of the package: Apache, MySQL and one of PHP,

Perl or Python. Apache is a web server. MySQL is an open-source database. PHP is a

scripting language that can manipulate information held in a database and generate web

pages dynamically each time content is requested by a browser. Other programs may

also be included in a package, such as phpMyAdmin which provides a graphical user

interface for the MySQL database manager, or the alternative scripting languages Python

or Perl
INTRODUCTION TO SERVER

CSS MANAGEMENT

Easily move CSS code from inline to head, from head to external sheet, from document to

document, or between external sheets. Cleaning up existing CSS in older pages has never

been easier.

CSS LAYOUTS

Easily incorporate CSS into your project with the new CSS layouts. Extensive comments

in each template explain the layout, so beginning and intermediate designers can learn

quickly. Each template can be customized for your project.

MAXIMIZE EFFICIENCY

Accelerate your workflow with Dreamweaver CS3, a faster, smoother version of the

preferred web design and development tool. Drop in FLV files, add images from Adobe

Photoshop, and test your content for mobile devices. Create visually or code directly, work

on your choice of Macintosh or Windows, and enjoy the benefits of intelligent integration

with other Adobe tools.

APPLY BEST PRACTICES

Dreamweaver CS3 makes it easy to apply best practices and accepted standards to ensure

your websites and applications play well with others. Build CSS-based websites from the

ground up with new CSS layouts, the unified CSS panel, and CSS visualization and

management tools. Ensure more reliable and consistent performance with the new

Browser Compatibility Check. Instantly preview your content for PCs, mobile devices, and

print, and find fast solutions to browser-specific CSS issues with the new CSS Advisor

website.
WEB DESIGNERS

Discover an exceptional web design workflow with Adobe Dreamweaver CS3 software.

Streamline design with helpful CSS features; preview your pages for PCs, mobile devices,

and print; and easily test pages for browser compatibility. Enjoy tight integration with

Adobe Photoshop CS3, Flash CS3 Professional, Fireworks CS3, and other Adobe tools.

WEB DEVELOPERS

Develop more reliable, consistent web applications based on universally accepted

development standards with Adobe Dreamweaver CS3. Take advantage of support for

leading web development technologies, including PHP, Adobe ColdFusion, and Ajax, for

both internal and external projects. Ensure consistency with helpful CSS features and

automated cross-browser compatibility testing.


HARDWARE AND SOFTWARE REQUIREMENTS

SOFTWARE REQUIREMNTS

The system must have the following software requirements:

 MySQL

 Net Beans

 Glassfish

 Windows operating system

HARDWARE REQUIREMNTS

The system has the following hardware requirements:

 Pentium IV Processor

 256 MB of RAM

 5GB of Hard Disk


SCREENSHOTS

USER INTERFACE;
DATABASE TABLE VIEW
FUTURE SCOPE

Well this project helps to reduce the residence problems too greater extent, it can

further expanded by making larger database or by adding more cities to the website or

by making it useful world wide.We can also add modules for train or bus bookings or

can also arrange trips along with residence facilities .

I have compiled this project keeping this point in full regards that it can be easily

upgraded if need arises. From time to time, new modules can be added to it or existing

ones can be modified.

Depending upon the organization, the function processes and needs may vary from

organization to organization. Therefore, the functionality of the project can be further

enhanced as per the requirements specification of different needs. For instance, any

organization can use this according to the services they want to provide.Similarly, the

project can be expanded to the required extent.


Conclusion

As a member of the team under the guidance of my trainer, I have been educated about

the java technologies .The particular area of to which my project serves extremely

helpful. I am required to understand and learn the intricacy involved in this area. I

would design input interfaces, design database, develop code, input test data, output

interfaces, and output test data. Completion of the development process will result in a

software package that will provide user friendly environment which is very easy to work

with, even for people with very little knowledge of computer. Management of various

tasks is incorporated in the package and will deliver the required information in a very

easy to use and easy to access manner. This package will provide accuracy, efficiency,

speed and easiness to the end user.


BIBLIOGRAPHY

1. https://www.oracle.com/java/index.html

2. https://wizpert.com/java-programming

3. http://www.tutorialspoint.com/java

4. The complete reference JAVA

You might also like