82
1. INTRODUCTION Spatial database systems manage large collections of geographic entities, which apart from spatial attributes contain non-spatial information (e.g., name, size, type, price, etc.). In this project, an interesting type of preference queries is studied, which selects the best spatial location with respect to the quality of facilities in its spatial neighborhood. 1.1 EXISTING SYSTEM Object ranking is a popular retrieval task in various applications. In relational databases, the tuples are ranked using an aggregate score function on their attribute values. For example, a real estate agency maintains a database that contains information of flats available for rent. A potential customer wishes to view the top-10 flats with the largest sizes and lowest prices. In this case, the score of each flat is expressed by the sum of two qualities: size and price, after normalization to the domain (e.g., 1 means the largest size and the lowest price). In spatial databases, ranking is often associated to nearest neighbor (NN) retrieval. Given a query location, we are interested in retrieving the set of nearest objects to it that qualify a condition (e.g., restaurants). Assuming that the set of interesting objects is indexed by 1

Comp

Embed Size (px)

Citation preview

Page 1: Comp

1. INTRODUCTION

Spatial database systems manage large collections of geographic entities, which

apart from spatial attributes contain non-spatial information (e.g., name, size, type,

price, etc.). In this project, an interesting type of preference queries is studied, which

selects the best spatial location with respect to the quality of facilities in its spatial

neighborhood.

1.1 EXISTING SYSTEM

Object ranking is a popular retrieval task in various applications. In relational

databases, the tuples are ranked using an aggregate score function on their attribute

values. For example, a real estate agency maintains a database that contains information

of flats available for rent. A potential customer wishes to view the top-10 flats with the

largest sizes and lowest prices. In this case, the score of each flat is expressed by the

sum of two qualities: size and price, after normalization to the domain (e.g., 1 means the

largest size and the lowest price). In spatial databases, ranking is often associated to

nearest neighbor (NN) retrieval. Given a query location, we are interested in retrieving

the set of nearest objects to it that qualify a condition (e.g., restaurants). Assuming that

the set of interesting objects is indexed by an R-tree, a distance bounds and traverse the

index in a branch-and-bound fashion can be applied to obtain the solution.

Disadvantages

1. Due to separate computations for different objects Simple Probing is inefficient

for large data sets.

2. Group Probing is still expensive as it examines all objects in D and computes its

component scores.

1.2 PROPOSED SYSTEM

The proposed design is

(i) Spatial ranking, which orders the objects according to their distance from a reference

point, and

1

Page 2: Comp

(ii) Non-spatial ranking, which orders the objects by an aggregate function on their non-

spatial values.

Our top- k spatial preference query integrates these two types of ranking in an

intuitive way. As indicated by our examples, this new query has a wide range of

applications in service recommendation and decision support systems. It is found that,

there is no existing efficient solution for processing the top-k spatial preference query

till today. A brute-force approach for evaluating is to compute the scores of all objects

in D and select the top-k ones. This method, however, is expected to be very expensive

for large input datasets. Branch and Bound algorithm is used to reduce the number of

objects that are to be examined.

2

Page 3: Comp

2. REQUIREMENT SPECIFICATION

2.1 HARDWARE SYSTEM CONFIGURATION

The Hardware specifications are used providing the efficiency and

responsiveness. By using this we can install the instructions and certificate of

authenticity. In this project hardware system configurations used are- processor of

Pentium-III, speed of 1.1GHz, RAM of 256 MB(min), hard disk of 20GB and Floopy

drive of 1.44MB

2.2 SOFTWARE SYSTEM CONFIGURATION

Software specifications are used designing the systems and to manage the time

complexity. New tools and techniques are announced in quick succession. This has

forced the software engineers and industry continuously looks for new approaches to

software designing development. In this project the software requirements are -

Operating System windows95/98/2000/XP with Apache Tomcat5.0/6.X as Application

Server. My Sql is used as the Database, supported by JDBC as the Database

Connectivity with HTML, Java and Jsp as the Front End.

2.3 FEASIBILITY STUDY

The feasibility of the project is analyzed in this phase and business proposal is

put forth with a very general plan for the project and some cost estimates. During

system analysis the feasibility study of the proposed system is to be carried out. This is

to ensure that the proposed system is not a burden to the company. For feasibility

analysis, some understanding of the major requirements for the system is essential.

Three key considerations involved in the feasibility analysis are

ECONOMICAL FEASIBILITY

TECHNICAL FEASIBILITY

SOCIAL FEASIBILITY

3

Page 4: Comp

ECONOMICAL FEASIBILITY

This study is carried out to check the economic impact that the system will

have on the organization. The amount of fund that the company can pour into the

research and development of the system is limited. The expenditures must be justified.

Thus the developed system as well within the budget and this was achieved because

most of the technologies used are freely available. Only the customized products had to

be purchased.

TECHNICAL FEASIBILITY

This study is carried out to check the technical feasibility, that is, the

technical requirements of the system. Any system developed must not have a high

demand on the available technical resources. This will lead to high demands on the

available technical resources. This will lead to high demands being placed on the client.

The developed system must have a modest requirement, as only minimal or null

changes are required for implementing this system.

SOCIAL FEASIBILITY

The aspect of study is to check the level of acceptance of the system by the user.

This includes the process of training the user to use the system efficiently. The user

must not feel threatened by the system, instead must accept it as a necessity. The level

of acceptance by the users solely depends on the methods that are employed to educate

the user about the system and to make him familiar with it. His level of confidence must

be raised so that he is also able to make some constructive criticism, which is

welcomed, as he is the final user of the system.

2.4 SOFTWARE ENVIRONMENT

2.4.1 Java Technology

Java technology is both a programming language and a platform.

With most programming languages, you either compile or interpret a program so

that you can run it on your computer. The Java programming language is unusual in that

a program is both compiled and interpreted. With the compiler, first you translate a

program into an intermediate language called Java byte codes —the platform-

4

Page 5: Comp

independent codes interpreted by the interpreter on the Java platform. The interpreter

parses and runs each Java byte code instruction on the computer. Compilation happens

just once; interpretation occurs each time the program is executed. The following figure

2.4 illustrates how this works.

Figure 2.4 How Java Virtual Machine works

Java byte codes as the machine code instructions for the Java Virtual Machine

(JVM). Every Java interpreter, whether it’s a development tool or a Web browser that

can run applets, is an implementation of the JVM. Java byte codes help make “write

once, run anywhere” possible. You can compile your program into byte codes on any

platform that has a Java compiler. The byte codes can then be run on any

implementation of the JVM. That means that as long as a computer has a JVM, the

same program written in the Java programming language can run on Windows 2000,

a Solaris workstation, or on an iMac.

Figure 2.5 How Java program run on different Operating Systems

The Java Platform

A platform is the hardware or software environment in which a program

runs. We’ve already mentioned some of the most popular platforms like

Windows 2000, Linux, Solaris, and MacOS. Most platforms can be described as

5

Page 6: Comp

a combination of the operating system and hardware. The Java platform differs

from most other platforms in that it’s a software-only platform that runs on top

of other hardware-based platforms.

The Java platform has two components:

The Java Virtual Machine (Java VM)

The Java Application Programming Interface (Java API)

You’ve already been introduced to the Java VM. It’s the base for the Java

platform and is ported onto various hardware-based platforms.

The Java API is a large collection of ready-made software components that

provide many useful capabilities, such as graphical user interface (GUI) widgets.

The Java API is grouped into libraries of related classes and interfaces; these

libraries are known as packages.

The following figure 2.1 depicts a program that’s running on the Java

platform. As the figure shows, the Java API and the virtual machine insulate the

program from the hardware.

Figure 2.1 Layered diagram of Java Virtual Machine

Native code is code that after you compile it, the compiled code runs on a

specific hardware platform. As a platform-independent environment, the Java

platform can be a bit slower than native code. However, smart compilers, well-

tuned interpreters, and just-in-time byte code compilers can bring performance

close to that of native code without threatening portability.

The most common types of programs written in the Java programming

language are applets and applications. An applet is a program that adheres to

certain conventions that allow it to run within a Java-enabled browser. However,

the Java programming language is not just for writing cute, entertaining applets

for the Web. The general-purpose, high-level Java programming language is also

6

Page 7: Comp

a powerful software platform. Using the generous API, you can write many

types of programs.

An application is a standalone program that runs directly on the Java

platform. A special kind of application known as a server serves and supports

clients on a network. Examples of servers are Web servers, proxy servers, mail

servers, and print servers. Another specialized program is a servlet. A servlet can

almost be thought of as an applet that runs on the server side. Java Servlets are a

popular choice for building interactive web applications, replacing the use of

CGI scripts. Servlets are similar to applets in that they are runtime extensions of

applications. Instead of working in browsers, though, servlets run within Java

Web servers, configuring or tailoring the server.

API support all these kinds of programs with packages of software

components that provides a wide range of functionality. Every full

implementation of the Java platform gives you the following features:

The essentials: Objects, strings, threads, numbers, input and output, data

structures, system properties, date and time, and so on.

Applets: The set of conventions used by applets.

Networking: URLs, TCP (Transmission Control Protocol), UDP (User

Data gram Protocol) sockets, and IP (Internet Protocol) addresses.

Internationalization: Help for writing programs that can be localized

for users worldwide. Programs can automatically adapt to specific

locales and be displayed in the appropriate language.

Security: Both low level and high level, including electronic signatures,

public and private key management, access control, and certificates.

Software components: Known as JavaBeansTM, can plug into existing

component architectures.

Object serialization: Allows lightweight persistence and

communication via Remote Method Invocation (RMI).

Java Database Connectivity (JDBCTM): Provides uniform access to a

wide range of relational databases.

7

Page 8: Comp

The Java platform also has APIs for 2D and 3D graphics, accessibility, servers,

collaboration, telephony, speech, animation, and more. The following figure

depicts what is included in the Java 2 SDK.

2.4.2 JDBC

In an effort to set an independent database standard API for Java; Sun

Microsystems developed Java Database Connectivity, or JDBC. JDBC offers a

generic SQL database access mechanism that provides a consistent interface to a

variety of RDBMSs. This consistent interface is achieved through the use of

“plug-in” database connectivity modules, or drivers. If a database vendor wishes

to have JDBC support, he or she must provide the driver for each platform that

the database and Java run on.

To gain a wider acceptance of JDBC, Sun based JDBC’s framework on

ODBC. As you discovered earlier in this chapter, ODBC has widespread support

on a variety of platforms. Basing JDBC on ODBC will allow vendors to bring

JDBC drivers to market much faster than developing a completely new

connectivity solution.

JDBC was announced in March of 1996. It was released for a 90 day public

review that ended June 8, 1996. Because of user input, the final JDBC v1.0

specification was released soon after.

The remainder of this section will cover enough information about JDBC for

you to know what it is about and how to use it effectively. This is by no means a

complete overview of JDBC. That would fill an entire book.

8

Page 9: Comp

Java Program

Compilers

Interpreter

My Program

Java is also unusual in that each Java program is both compiled and

interpreted. With a compile you translate a Java program into an intermediate

language called Java byte codes the platform-independent code instruction is

passed and run on the computer.

Compilation happens just once; interpretation occurs each time the program is

executed. The figure illustrates how this works.

You can think of Java byte codes as the machine code instructions for the

Java Virtual Machine (Java VM). Every Java interpreter, whether it’s a Java

development tool or a Web browser that can run Java applets, is an

implementation of the Java VM. The Java VM can also be implemented in

hardware.

Java byte codes help make “write once, run anywhere” possible. You can

compile your Java program into byte codes on my platform that has a Java

compiler. The byte codes can then be run any implementation of the Java

VM. For example, the same Java program can run Windows NT, Solaris, and

Macintosh.

9

Page 10: Comp

2.4.3 Tomcat 6.0 web server

Tomcat is an open source web server developed by Apache Group. Apache

Tomcat is the servlet container that is used in the official Reference Implementation for

the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer

Pages specifications are developed by Sun under the Java Community Process. Web

Servers like Apache Tomcat support only web components while an application server

supports web components as well as business components (BEAs Weblogic, is one of

the popular application server).To develop a web application with jsp/servlet install any

web server like JRun, Tomcat etc to run your application.

Figure Tomcat Webserver

10

Page 11: Comp

3. SYSTEM DESIGN

3.1 INPUT DESIGN

The input design is the link between the information system and the user. It

comprises the developing specification and procedures for data preparation and those

steps are necessary to put transaction data in to a usable form for processing can be

achieved by inspecting the computer to read data from a written or printed document or

it can occur by having people keying the data directly into the system. The design of

input focuses on controlling the amount of input required, controlling the errors,

avoiding delay, avoiding extra steps and keeping the process simple. The input is

designed in such a way so that it provides security and ease of use with retaining the

privacy. Input Design considered the following things that are what is given as a input,

how the data should be arranged or coded, dialog to guide the operating personnel in

providing point, Methods for preparing the input validations and steps to follow when

error occur.

OBJECTIVES

1. Input Design is the process of converting a user-oriented description of the input into

a computer-based system. This design is important to avoid errors in the data input

process and show the correct direction to the management for getting correct

information from the computerized system.

2. It is achieved by creating user-friendly screens for the data entry to handle large

volume of data. The goal of designing input is to make data entry easier and to be free

from errors. The data entry screen is designed in such a way that all the data

manipulates can be performed. It also provides record viewing facilities.

3. When the data is entered it will check for its validity. Data can be entered with the

help of screens. Appropriate messages are provided as when needed so that the user will

not be in maize of instant. Thus the objective of input design is to create an input layout

that is easy to follow

11

Page 12: Comp

3.2 OUTPUT DESIGN

A quality output is one, which meets the requirements of the end user and

presents the information clearly. In any system results of processing are communicated

to the users and to other system through outputs. In output design it is determined how

the information is to be displaced for immediate need and also the hard copy output. It

is the most important and direct source information to the user. Efficient and intelligent

output design improves the system’s relationship to help user decision-making.

1. Designing computer output should proceed in an organized, well thought out manner;

the right output must be developed while ensuring that each output element is designed

so that people will find the system can use easily and effectively. When analysis design

computer output, they should Identify the specific output that is needed to meet the

requirements.

2. Select methods for presenting information.

3. Create document, report, or other formats that contain information produced by the

system.

The output form of an information system should accomplish one or more of the

following objectives.

Convey information about past activities, current status or projections of the

Future.

Signal important events, opportunities, problems, or warnings.

Trigger an action.

Confirm an action.

3.3 Data Flow Diagrams / Use Case Diagram / Flow Diagram

The DFD is also called as bubble chart. It is a simple graphical formalism that

can be used to represent a system in terms of the input data to the system, various

processing carried out on these data, and the output data is generated by the system.

12

Page 13: Comp

DFD 1:

13

Page 14: Comp

DFD 2:

3.4 UML Diagrams

14

Page 15: Comp

Usecase diagram for admin/user

Activity Diagram for Users:

15

Page 16: Comp

Activity for Admin:

16

Page 17: Comp

Class Diagram for admin/user:

17

Page 18: Comp

Sequence Diagram for admin/user:

18

Page 19: Comp

4. IMPLEMENTATION

19

Page 20: Comp

Spatial database systems manage large collections of geographic entities, which

apart from spatial attributes contain non-spatial information (e.g., name, size, type,

price, etc.). In this paper, we study an interesting type of preference queries, which

select the best spatial location with respect to the quality of facilities in its spatial

neighborhood. Given a set D of interesting objects (e.g., candidate locations), a top-k

spatial preference query retrieves the k objects in D with the highest scores. The score

of an object is defined by the quality of features (e.g., facilities or services) in its spatial

neighborhood. As a motivating example, consider a real estate agency office that holds

a database with available flats for lease. Here “feature” refers to a class of objects in a

spatial map such as specific facilities or services. A customer may want to rank the

contents of this database with respect to the quality of their locations, quantized by

aggregating nonspatial characteristics of other features (e.g., restaurants, cafes, hospital,

market, etc.) in the spatial neighborhood of the flat (defined by a spatial range around

it). Quality may be subjective and query-parametric. For example, a user may define

quality with respect to non-spatial attributes of restaurants around it (e.g., whether they

serve seafood, price range, etc.).

4.1 Module Description:

1. Spatial Ranking

2. Non-Spatial ranking

3. Neighbor (NN) Retrieval

4. Spatial Query Evaluation on R-trees

Spatial Ranking

Spatial ranking which orders the objects according to their distance from a reference

point.

Non-Spatial Ranking

Non-spatial ranking which orders the objects by an aggregate function on their non-

spatial values. Our top- k spatial preference query integrates these two types of ranking

in an intuitive way. As indicated by our examples, this new query has a wide range of

20

Page 21: Comp

applications in service recommendation and decision support systems. To our

knowledge, there is no existing efficient solution for processing the top-k spatial

preference query.

Neighbor (NN) Retrieval

Object ranking is a popular retrieval task in various applications. In relational databases,

we rank tuples using an aggregate score function on their attribute values. For example,

a real estate agency maintains a database that contains information of flats available for

rent. A potential customer wishes to view the top-10 flats with the largest sizes and

lowest prices. In this case, the score of each flat is expressed by the sum of two

qualities: size and price, after normalization to the domain [0,1] (e.g., 1 means the

largest size and the lowest price). In spatial databases, ranking is often associated to

nearest neighbor (NN) retrieval. Given a query location, we are interested in retrieving

the set of nearest objects to it that qualify a condition (e.g., restaurants). Assuming that

the set of interesting objects is indexed by an R-tree [3], we can apply distance bounds

and traverse the index in a branch-and-bound fashion to obtain the answer.

Nevertheless, it is not always possible to use multidimensional indexes for top-k

retrieval. First, such indexes break-down in high dimensional spaces. Second, top-k

queries may involve an arbitrary set of user-specified attributes (e.g., size and price)

from possible ones (e.g., size, price, distance to the beach, number of bedrooms, floor,

etc.) and indexes may not be available for all possible attribute combinations (i.e., they

are too expensive to create and maintain). Third, information for different rankings to be

combined (i.e.,for different attributes) could appear in different databases (in a

distributed database scenario) and unified indexes may not exist for them. Solutions for

top-k queries focus on the efficient merging of object rankings that may arrive from

different (distributed) sources. Their motivation is to minimize the number of accesses

to the input rankings until the objects with the top-k aggregate scores have been

identified. To achieve this, upper and lower bounds for the objects seen so far are

maintained while scanning the sorted lists.

Spatial Query Evaluation (R-tree)

21

Page 22: Comp

The most popular spatial access method is the R-tree, which indexes minimum

bounding rectangles (MBRs) of objects. Figure 2 shows a set D = fp1;: : : ; p8g of

spatial objects (e.g., points) and an R-tree that indexes them. R-trees can efficiently

process main spatial query types, including spatial range queries, nearest neighbor

queries, and spatial joins. Given a spatial region W, a spatial range query retrieves from

D the objects that intersect W. For instance, consider a range query that asks for all

objects within the shaded area in Figure 2. Starting from the root of the tree, the query is

processed by recursively following entries, having MBRs that intersect the query

region. For instance, e1 does not intersect the query region, thus the subtree pointed by

e1 cannot contain any query result. In contrast, e2 is followed by the algorithm and the

points in the corresponding node are examined recursively to find the query result.

5. SOURCE CODE

MAIN PAGE

22

Page 23: Comp

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Ranking Spatial Data by Quality Preferences</title>

<link href="style.css" rel="stylesheet" type="text/css" />

<script language="JavaScript">

javascript:window.history.forward(1);

</script>

</head>

<body>

<form id="form1" name="form1" method="post" action="searchengine.jsp">

<div id="topheader">

<div class="topmenu_area"><a href="index.html" class="home">Home</a> <a

href="userlogin.jsp" class="about">Login</a> <a href="register.jsp"

class="search">Register</a> </div>

<div class="banner_textarea">

<p class="banner_head">Ranking Spatial Data by Quality Preferences</p>

</div>

<div class="search_menu_banner">

<div class="search_background">

<div class="searchname">Search</div>

<div class="searchbox">

<label>

<input name="textfield" type="text" class="searchtextbox" />

</label>

</div>

<div class="searchbox">

<div align="center"><a href="searchengine.jsp" class="go">go</a></div>

</div>

</div>

23

Page 24: Comp

<div class="menu_area"><a href="vote.jsp" class="addidea">Vote</a> <a

href="lists.jsp" class="loginhere">Lists</a> <a href="buzz.jsp"

class="comments">Comments</a> <a href="members.jsp"

class="contact">Members</a></div>

</div>

</div>

<div id="body_area">

<div class="left">

<div class="morelinks_top"></div>

<div class="morelinks_area">

<div class="morelinks_head">Categories</div>

<div class="links_morearea">

<a href="index.html" class="morelink">Home</a><br /><br>

<a href="lists1.jsp" class="morelink">Lists</a> <br /><br>

<a href="vote.jsp" class="morelink">Vote</a><br /><br>

<a href="buzz.jsp" class="morelink">Buzz</a><br /><br>

<a href="members.jsp" class="morelink">Members</a> <br /><br>

<a href="adminlogin.jsp" class="morelink">Admin Login</a> <br /><br>

</div>

</div>

<div class="morelinks_bottom"></div>

</div>

<div class="body_area1">

<div class="mid">

<div class="tick_head">Welcome to <span class="tick_head1">Online Ranking

System</span></div>

<div class="inner_banner">

<p class="worksheet">Menu</p>

<p><a href="index.html" class="innerlink">Home</a><br />

<a href="lists1.jsp" class="innerlink">Lists</a> <br />

<a href="vote.jsp" class="innerlink">Vote</a><br />

24

Page 25: Comp

<a href="buzz.jsp" class="innerlink">Buzz</a><br />

<a href="members.jsp" class="innerlink">Members</a> <br />

</p>

</div>

</div>

<div class="right_area">

<div class="right_top"></div>

<div class="right_head">

<div class="morelinks_head">Latest Blogs </div>

</div>

<div class="right_links_area">

<div class="links_morearea"><a href="index.html"

class="morelink">Home</a><br />

<a href="lists1.jsp" class="morelink">Lists</a> <br />

<a href="vote.jsp" class="morelink">Vote</a><br />

<a href="buzz.jsp" class="morelink">Buzz</a><br />

<a href="members.jsp" class="morelink">Members</a> <br />

</div>

<div class="freeregistration">

<div align="center"><a href="register.jsp" style="text-decoration:none;"><span

class="free">Free Registration</span></a></div>

</div>

</div>

<div class="right_bottom"></div>

</div>

</div>

</div>

<div id="fotter">

<div id="fotter_1">

<div class="fotter_leftarea">

<div class="fotter_links">

25

Page 26: Comp

<a href="index.html" class="fotterlink">Home</a> | <a href="register.jsp"

class="fotterlink">Register</a> | <a href="blog.jso" class="fotterlink">Blog</a> | <a

href="adminlogin.jsp" class="fotterlink">Admin Login</a> | <a href="login.jsp"

class="fotterlink">User login</a> </div>

<div class="fotter_designed"></div>

</div>

<div class="fotter_rightarea">

<div class="fotter_validation"></div>

<div class="fotter_copyrights">sri prakash college of technology <br />

rajahmundry.</div>

</div>

</div>

</div>

</form>

</body>

</html>

REGISTRATION PAGE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Ranking Spatial Data by Quality Preferences</title>

<link href="style.css" rel="stylesheet" type="text/css" />

<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"

media="screen" title="no title" charset="utf-8" />

<link rel="stylesheet" href="css/template.css" type="text/css"

media="screen" title="no title" charset="utf-8" />

<script

src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"

type="text/javascript"></script>

26

Page 27: Comp

<script src="JS/jquery.validationEngine-en.js"

type="text/javascript"></script>

<script src="JS/jquery.validationEngine.js"

type="text/javascript"></script>

<!-- AJAX SUCCESS TEST FONCTION

<script>function callSuccessFunction(){alert("success executed")}

function callFailFunction(){alert("fail executed")}

</script>

-->

<script>

$(document).ready(function() {

// SUCCESS AJAX CALL, replace "success: false," by: success : function()

{ callSuccessFunction() },

$("#formID").validationEngine()

//$.validationEngine.loadValidation("#date")

//alert($("#formID").validationEngine({returnIsValid:true}))//

$.validationEngine.buildPrompt("#date","This is an example","error") //

Exterior prompt build example

// input prompt close example

//$.validationEngine.closePrompt(".formError",true)

// CLOSE ALL OPEN PROMPTS

});

// JUST AN EXAMPLE OF VALIDATIN CUSTOM FUNCTIONS :

funcCall[validate2fields]

function validate2fields(){

if($("#firstname").val() =="" || $("#lastname").val() == ""){

return true;

}else{

return false;

}

}

27

Page 28: Comp

</script>

<style type="text/css">

#font

{

font-family:verdana;

font-size:12px;

font-color:green;

padding:3px 3px 3px 3px;

}

</style>

</head>

<body>

<div id="topheader">

<div class="topmenu_area"><a href="index.html" class="home">Home</a> <a

href="userlogin.jsp" class="about">Login</a> <a href="register.jsp"

class="search">Register</a> </div>

<div class="banner_textarea">

<p class="banner_head">Ranking Spatial Data by Quality Preferences</p>

</div>

<div class="search_menu_banner">

<div class="search_background">

<div class="searchname">Search</div>

<form id="form1" name="form1" method="post"

action="searchengine.jsp">

<div class="searchbox">

<label>

<input name="textfield" type="text" class="searchtextbox" />

</label>

</div>

<div class="searchbox">

<div align="center"><a href="searchengine.jsp" class="go">go</a></div>

</div></form>

28

Page 29: Comp

</div>

<div class="menu_area"><a href="vote.jsp" class="addidea">Vote</a> <a

href="lists.jsp" class="loginhere">Lists</a> <a href="buzz.jsp"

class="comments">Comments</a> <a href="members.jsp"

class="contact">Members</a></div>

</div>

</div>

<div id="body_area">

<div class="left">

<div class="morelinks_top"></div>

<div class="morelinks_area">

<div class="morelinks_head">Categories</div>

<div class="links_morearea">

<a href="index.html" class="morelink">Home</a><br /><br>

<a href="lists1.jsp" class="morelink">Lists</a> <br /><br>

<a href="vote.jsp" class="morelink">Vote</a><br /><br>

<a href="buzz.jsp" class="morelink">Buzz</a><br /><br>

<a href="members.jsp" class="morelink">Members</a> <br /><br>

<a href="adminlogin.jsp" class="morelink">Admin Login</a>

<br /><br>

</div>

</div>

<div class="morelinks_bottom"></div>

</div>

<div class="body_area1">

<div class="mid"><br>

<div class="tick_head"><span class="tick_head1">New User Register

Here</span></div><br><br>

<div class="wrap">

<form id="formID" class="formular" method="post" action="insert.jsp">

<fieldset>

<legend>User informations</legend>

29

Page 30: Comp

<label>

<span>Desired username : </span>

<input value="" class="validate[required,custom[noSpecialCaracters],length[0,20]]"

type="text" name="user" id="user" />

</label><br>

<label>

<span>First name (optional)</span>

<input value="" class="validate[optional,custom[onlyLetter],length[0,100]] text-input"

type="text" name="firstname" id="firstname" />

</label><br>

<label>

<span>Last name : </span>

<input value=""

class="validate[required,custom[onlyLetter],length[0,100],funcCall[validate2fields]]

text-input" type="text" id="lastname" name="lastname" />

</label><br>

<div>

<span><font color="#FF0000">Gender :</font> <br /></span><br>

<input class="validate[required] radio" type="radio" name="data[User][preferedColor]"

id="radio1" value="5">&nbsp;<font color="#006600">Male</font>

<input class="validate[required] radio" type="radio" name="data[User][preferedColor]"

id="radio2" value="3"/>&nbsp;<font color="#006600">Female</font>

</div><br>

<div>

<span><font color="#FF0000">Interested In : </font><br /></span><br>

<input class="validate[minCheckbox[2]] checkbox" type="checkbox"

name="data[User3][preferedColor]" id="data[User3][preferedColor]"

value="5">&nbsp;<font color="#006600">Java</font>

<input class="validate[minCheckbox[2]] checkbox" type="checkbox"

name="data[User3][preferedColor]" id="maxcheck2" value="3"/>&nbsp;<font

color="#006600">Dotnet</font>

30

Page 31: Comp

<input class="validate[minCheckbox[2]] checkbox" type="checkbox"

name="data[User3][preferedColor]" id="maxcheck3" value="9"/>&nbsp;<font

color="#006600">PHP</font>

</div><br>

<label><span>Date : (format YYYY-MM-DD)</span>

<input value="1111-11-11" class="validate[required,custom[date]] text-input"

type="text" name="date" id="date" />

</label>

<br>

<label>

<span>Ranking Area 1:</span>

<select name="sport" class="validate[required]" id="sport" style="font-

family:verdana;" >

<option value="">Choose a Area</option>

<option value="option1">JAVA</option>

<option value="option2">DOTNET</option>

<option value="option3">PHP</option>

</select>

</label>

<br>

<label>

<span>Age : </span>

<input value="" class="validate[required,custom[onlyNumber],length[0,3]] text-input"

type="text" name="age" id="age" />

</label>

<br><label><span>Telephone : </span>

<input value="" class="validate[required,custom[telephone]] text-input" type="text"

name="telephone" id="telephone" />

</label><br>

</fieldset>

<fieldset>

<legend>Password</legend>

31

Page 32: Comp

<label>

<span>Password : </span>

<input value="" class="validate[required,length[6,11]] text-input" type="password"

name="password" id="password" />

</label>

<label>

<span>Confirm password : </span>

<input value="" class="validate[required,confirm[password]] text-input"

type="password" name="password2" id="password2" />

</label>

</fieldset>

<fieldset>

<legend>Email</legend>

<label>

<span>Email address : </span>

<input value="" class="validate[required,custom[email]] text-input" type="text"

name="email" id="email" />

</label>

<label>

<span>Confirm email address : </span>

<input value="" class="validate[required,confirm[email]] text-input" type="text"

name="email2" id="email2" />

</label>

</fieldset>

<fieldset>

<legend>Comments</legend>

<label>

<span>Description : </span>

<textarea value="[email protected]" class="validate[required,length[6,300]] text-input"

name="comments" id="comments" /> </textarea>

</label>

</fieldset>

32

Page 33: Comp

<fieldset>

<legend>Conditions</legend><div class="infos">Checking this box indicates that you

accept terms of use. If you do not accept these terms, do not use this website : </div>

<label>

<span class="checkbox">I accept terms of use : </span>

<input class="validate[required] checkbox" type="checkbox" id="agree"

name="agree"/>

</label>

</fieldset>

<input class="submit" type="submit" value="Validate & Send the form!" style="font-

family:verdana;font-size:12px;color:red;border:1px solid green;"/>

<hr/>

</form>

</div>

</div>

<div class="right_area">

<div class="right_top"></div>

<div class="right_head">

<div class="morelinks_head">Latest Blogs </div>

</div>

<div class="right_links_area">

<div class="links_morearea"><a href="index.html"

class="morelink">Home</a><br />

<a href="lists1.jsp" class="morelink">Lists</a> <br />

<a href="vote.jsp" class="morelink">Vote</a><br />

<a href="buzz.jsp" class="morelink">Buzz</a><br />

<a href="members.jsp" class="morelink">Members</a> <br />

</div>

<div class="freeregistration">

<div align="center"><a href="register.jsp" style="text-decoration:none;"><span

class="free">Free Registration</span></a></div>

</div>

33

Page 34: Comp

</div>

<div class="right_bottom"></div>

</div>

</div>

</div>

</body>

</html>

LOGIN PAGE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Ranking Spatial Data by Quality Preferences</title>

<link href="style.css" rel="stylesheet" type="text/css" />

<link href="css/style.css" rel="stylesheet" type="text/css" />

<style type="text/css">

/* CSS Document */

.userlogin {

font-family:Verdana, Arial, Helvetica, sans-serif;

font-size:25px;

color:#FFFFFF;

height:24;

padding:15px 10px 5px 3px;

text-decoration:none;

font-weight:bold;

}

.yellow

{

font-family:Verdana;

34

Page 35: Comp

font-size:14px;

color:yellow;

padding:2px 3px 5px 3px;

}

.fielditem {

font-size: 12px;

padding: 5px 2px 5px 2px;

float: center;

width: 300px;

font-family:verdana;

}

.fielditem .error {

background-image:url();

background-repeat: no-repeat;

background-position: 0px 2px;

padding: 0px 0px 0px 10px;

font-weight: bold;

font-family:verdana;

}

.fielditem input {

border: 2px solid #75bd24;

background-color: #e7ffea;

width: 300px;

font-family:verdana;

font-size: 15px;

color: #333;

padding: 6px;

font-size: 14px;

}

.fielditem input:focus {

border: 3px solid #F79421;

background-color: #FFF;

35

Page 36: Comp

}

.paragraping2

{

font-family:Verdana, Arial, Helvetica, sans-serif;

font-size:12px;

color:#2e2e2e;

padding:2px 2px 2px 2px;

text-decoration:none;

font-weight:Normal;

line-height:1.7em;

align:justify;

}

</style>

<script language="javascript">

function validation()

{

var a=document.form3.user.value;

var b=document.form3.password2.value;

if(a=="")

{

alert("Please Enter the Username");

return false;

}

if(b=="")

{

alert("Please Enter the Password");

return false;

}

else

{

36

Page 37: Comp

return true;

}

}

</script>

</head>

<body>

<div id="topheader">

<div class="topmenu_area"><a href="index.html" class="home">Home</a> <a

href="userlogin.jsp" class="about">Login</a> <a href="register.jsp"

class="search">Register</a> </div>

<div class="banner_textarea">

<p class="banner_head">Ranking Spatial Data by Quality Preferences</p>

</div>

<div class="search_menu_banner">

<div class="search_background">

<div class="searchname">Search</div> <form id="form1" name="form1"

method="post" action="searchengine.jsp">

<div class="searchbox">

<label>

<input name="bookid" type="text" class="searchtextbox" />

</label>

</div>

<div class="searchbox">

<div align="center"><a href="searchengine.jsp" class="go">go</a></div>

</div>

</form>

</div>

<div class="menu_area"><a href="vote.jsp" class="addidea">Vote</a> <a

href="lists.jsp" class="loginhere">Lists</a> <a href="buzz.jsp"

37

Page 38: Comp

class="comments">Comments</a> <a href="members.jsp"

class="contact">Members</a></div> </div>

</div>

<table align="center" width="1000" style="border:1px solid #d2d2d2;"

bgcolor="#FFFFCC">

<form name="form3" method="post" action="userinsert1.jsp" onsubmit="return

validation()">

<tr>

<td>

<table align="center" width="741" height="290" cellpadding="0"

background="images/back.jpg">

<tr>

<td height="112" colspan="3" align="center" class="userlogin">Login Your

Account</td>

</tr>

<tr>

<td width="58"></td>

<td width="188" height="91" class="yellow">UserName:</td>

<td width="485" class="fielditem"><input type="text" name="user" value=""></td>

</tr>

<tr>

<td></td>

<td width="188" height="71" class="yellow">Password:</td>

<td width="485" class="fielditem"><input type="password" name="password2"

value=""></td>

</tr>

<tr>

<td></td>

<td width="188" height="71"></td>

<td

widt

h="485">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<inp

38

Page 39: Comp

ut type="submit" name="submit" value="Login" style="border:1px solid

white;color:red;font-size:15px;font-family:verdana;width:100px;height:30px;"></td>

</tr>

</table>

</td>

</tr>

</form>

</table>

<table align="center" width="100%" height="10%">

<tr>

<td height="63" align="center" background="images/fotter_bg.jpg"><font style="font-

family:verdana;font-size:12px;color:white;">Ranking Spatial Data by Quality

Preferences</font></td>

</tr>

</table>

</body>

</html>

Admin page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Ranking Spatial Data by Quality Preferences</title>

<link href="style.css" rel="stylesheet" type="text/css" />

<link href="css/style.css" rel="stylesheet" type="text/css" />

<!-- ..//JQuery Source\\.. -->

<script type="text/javascript" src="JS/jquery-1.4.2.min.js"></script>

<!-- ..//JavaScript Code for this page\\.. -->

<script type="text/javascript">

$(document).ready(function(){

39

Page 40: Comp

$("#login_frm").submit(function(){

//remove previous class and add new "myinfo" class $

("#msgbox").removeClass().addClass('myinfo').text('Validating Your Login

').fadeIn(2000);

this.timer = setTimeout(function () {

$.ajax({

url: 'check.jsp',

data: 'un='+ $('#login_id').val() +'&pw=' + $('#password').val(),

type: 'post',

success: function(msg){

if(msg != 'ERROR') // Message Sent, check and redirect

{ // and direct to the success page

$("#msgbox").html('Login Verified, Logging in.....').addClass('myinfo').fadeTo(900,1,

function()

{

//redirect to secure page

document.location='login.jsp?user='+msg;

});

}

else

{

$

("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox

{

//add message and change the class of the box and start fading

$(this).html('Sorry, Wrong Combination Of Username And

Password.').removeClass().addClass('myerror').fadeTo(900,1);

});

40

Page 41: Comp

}

}

});

}, 200);

return false;

}); });

</script>

<script language="JavaScript">

javascript:window.history.forward(1);

</script>

</head>

<body>

<div id="topheader">

<div class="topmenu_area"><a href="index.html" class="home">Home</a> <a

href="userlogin.jsp" class="about">Login</a> <a href="register.jsp"

class="search">Register</a> </div>

<div class="banner_textarea">

<p class="banner_head">Ranking Spatial Data by Quality Preferences</p>

</div>

<div class="search_menu_banner">

<div class="search_background">

<div class="searchname">Search</div>

<div class="searchbox"> <label>

<input name="textfield" type="text" class="searchtextbox" />

</label>

</div>

<div class="searchbox">

<div align="center"><a href="#" class="go">go</a></div>

</div>

</div>

41

Page 42: Comp

<div class="menu_area"><a href="vote.jsp" class="addidea">Vote</a> <a

href="lists.jsp" class="loginhere">Lists</a> <a href="buzz.jsp"

class="comments">Comments</a> <a href="members.jsp"

class="contact">Members</a></div> </div>

</div>

<div id="body_area">

<div class="left">

<div class="morelinks_top"></div>

<div class="morelinks_area">

<div class="morelinks_head">Categories</div>

<div class="links_morearea">

<a href="index.html" class="morelink">Home</a><br />

<a href="adminlogin.jsp" class="morelink">Admin Login</a> <br />

<a href="userlogin.jsp" class="morelink">User login</a><br />

<a href="register.jsp" class="morelink">Register</a><br />

<a href="buzz.jsp" class="morelink">blog</a> <br />

<a href="vote.jsp" class="morelink">Vote</a><br />

<a href="lists.jsp" class="morelink">Top Lists</a><br />

</div>

</div>

<div class="morelinks_bottom"></div>

</div>

<div class="body_area1">

<div class="mid">

<div class="tick_head"><span class="tick_head1">Admin Login

Here</span></div>

<form name="login_frm" id="login_frm" action="check.jsp" method="post">

<div id="login_box">

<div id="login_header">

Login

</div>

42

Page 43: Comp

<div id="form_val">

<div class="label">User Id :</div>

<div class="control"><input type="text" name="login_id"

id="login_id"/>&nbsp;Admin</div>

<div class="label">Password:</div>

<div class="control"><input type="password" name="password"

id="password"/>&nbsp;Admin</div>

<div style="clear:both;height:0px;"></div>

<div id="msgbox"></div>

</div>

<div id="login_footer">

<label>

<input type="submit" name="login" id="login" value="Login"

class="send_button" />

</label>

</div>

</div>

</form>

</div>

<div class="right_area">

<div class="right_top"></div>

<div class="right_head">

<div class="morelinks_head">Latest Blogs </div>

</div>

<div class="right_links_area">

<div class="links_morearea"><a href="index.html"

class="morelink">Home</a><br />

<a href="adminlogin.jsp" class="morelink">Admin Login</a> <br />

<a href="userlogin.jsp" class="morelink">User login</a><br />

<a href="register.jsp" class="morelink">Register</a><br />

<a href="buzz.jsp" class="morelink">blog</a> <br />

</div>

43

Page 44: Comp

<div class="freeregistration">

<div align="center"><span class="free">Free</span> registration</div>

</div>

</div>

<div class="right_bottom"></div>

</div>

</div>

</div>

<table align="center" width="100%" height="10%">

<tr>

<td height="63" align="center" background="images/fotter_bg.jpg"><font style="font-

family:verdana;font-size:12px;color:white;">Ranking Spatial Data by Quality

Preferences</font></td>

</tr>

</table>

</body>

</html>

6. SCREEN SHOTS

Home page:

44

Page 45: Comp

Registration page:

45

Page 46: Comp

Admin Login:

46

Page 47: Comp

Add Book Details:

47

Page 48: Comp

User Profile View and Delete:

48

Page 49: Comp

User Login:

49

Page 50: Comp

View Books and Vote:

50

Page 51: Comp

Search by Book using Index and Search Engine Technique:

51

Page 52: Comp

52

Page 53: Comp

View Rank Here:

53

Page 54: Comp

Update Spatial Queries:

54

Page 55: Comp

View Votes:

55

Page 56: Comp

Get Reward from Admin:

56

Page 57: Comp

Blog Discussion:

57

Page 58: Comp

Admin View Members Lists:

58

Page 59: Comp

Admin View Top Ranker Lists:

59

Page 60: Comp

View User Chart:

60

Page 61: Comp

7. CONCLUSION

61

Page 62: Comp

In this project spatial preference queries, which provide a novel type of ranking

for spatial objects based on qualities of features in their neighborhood. The

neighborhood of an object p is captured by the scoring function: (i) the range score

restricts the neighborhood to a crisp region centered at p, whereas (ii) the influence

score relaxes the neighborhood to the whole space and assigns higher weights to

locations closer to p.

Three algorithms are presented for processing top-k spatial preference queries.

The baseline algorithm SP computes the scores of every object by querying on

feature datasets. The algorithm GP is a variant of SP that reduces I/O cost by computing

scores of objects in the same leaf node concurrently. The algorithm BB derives upper

bound scores for non-leaf entries in the object tree, and prunes those that cannot lead to

better results. In the future, we will study the top-k spatial preference query on road

network, in which the distance between two points is defined by their shortest path

distance rather than their Euclidean distance. The challenge is to develop alternative

methods for computing the upper bound scores for a group of points on a road network.

9. BIBLIOGRAPHY

62

Page 63: Comp

[1] Raghu Ramakrishna, “Database Management System,” Tata McGraw-Hill Third

Edition, 2003.

[2] Joseph J. Bambara, “J2EE UNLEASHED, ” SAMS Edition, 2002.

[3] Korl Moss ‘Java Servlets’ Tata McGraw-Hill Second Edition, 1999.

[4] Korth Sudarshan ‘Database System concepts’ Tata McGraw-Hill Fourth Edition,

2002

[5] Accoria ‘ Rock web server and load balancer’ http://www.accoria.com.

[6] Amazon Web Services ’Amazon Web Services (AWS)’ http://aws.amazon.com.

63