Академический Документы
Профессиональный Документы
Культура Документы
Broadcast Environments
Abstract:
Location-based spatial queries (LBSQs) refer to spatial queries whose answers rely on the
location of the inquirer. Efficient processing of LBSQs is of critical importance with the
ever-increasing deployment and use of mobile technologies. We show that LBSQs have
certain unique characteristics that the traditional spatial query processing in centralized
databases does not address. For example, a significant challenge is presented by wireless
broadcasting environments, which have excellent scalability but often exhibit high-
latency database access. In this paper, we present a novel query processing technique
that, though maintaining high scalability and accuracy, manages to reduce the latency
considerably in answering LBSQs. Our approach is based on peer-to-peer sharing, which
enables us to process queries without delay at a mobile host by using query results cached
in its neighboring mobile peers. We demonstrate the feasibility of our approach through a
probabilistic analysis, and we illustrate the appeal of our technique through extensive
simulation results.
Chapter 1 - Introduction
SPATIAL query processing is becoming an integral part of many new mobile
applications. Recently, there has been a growing interest in the use of location-based
spatial queries (LBSQs), which represent a set of spatial queries that retrieve information
based on mobile users’ current locations [2], [29].
User mobility and data exchange through wireless communication give LBSQs
some unique characteristics that the traditional spatial query processing in centralized
databases does not address. Novel query processing techniques must be devised to handle
the following new challenges:
The wireless environment and the communication constraints play an important role in
determining the strategy for processing LBSQs. In the simplest approach, a user
establishes a point-to-point communication with the server so that her queries can be
answered on demand. However, this approach suffers from several drawbacks. First, it
may not scale to very large user populations. Second, to communicate with the server, a
client must most likely use a fee-based cellular-type network to achieve a reasonable
operating range. Third, users must reveal their current location and send it to the server,
which may be undesirable for privacy reasons [19]. A more advanced solution is the
wireless broadcast model [1], [15], [30]. It can support an almost-unlimited number of
mobile hosts (MHs) over a large geographical area with a single transmitter. With the
broadcast model, MHs do not submit queries. Instead, they tune in to the broadcast
channel for information that they desire. Hence, the user’s location is not revealed. One
of the limitations of the broadcast model is that it restricts data access to be sequential.
Queries can only be fulfilled after all the required on-air data arrives. This is why in some
cases; a 5-minute delay to the query “find the top-three nearest hospitals” would not be
unusual.
In general, there are two approaches for mobile data access. One is the on-demand access
model, and the other is the wireless broadcast model. For the on-demand access model,
point-to-point connections are established between the server and the mobile clients, and
the server processes queries that the clients submit on demand. For the wireless broadcast
model, the server repeatedly broadcasts all the information in wireless channels, and the
clients are responsible for filtering the information. An example of such a system is the
Microsoft DirectBand Network. The advantage of the broadcast model over the on-
demand model is that it is a scalable approach. However, the broadcast model has large
latency, as clients have to wait for the information that they need in a broadcasting cycle.
If a client misses the packets that it needs, it has to wait for the next broadcast cycle.
Thus, the general access protocol for retrieving data on a wireless broadcast
channel involves three main steps [15]:
The initial probe: A client tunes in to the broadcast channel and determines when the
next index segment will be broadcast.
Index search: The client accesses a sequence of pointers in the index segment to figure
out when to tune in to the broadcast channel to retrieve the required data.
Data retrieval: The client tunes in to the channel when packets containing the required
data arrive and then downloads all the required information.
Two parameters, access latency and tuning time, characterize the broadcast
model. The access latency represents the time duration from the point that a client
requests its data to the point that the desired data is received. The tuning time is the
amount of time spent by a client listening to the broadcast channel, which proportionally
represents the power consumption of the client.
However, nearly all the existing spatial access methods are designed for databases with
random access disks. These existing techniques cannot be used effectively in a wireless
broadcast environment, where only sequential data access is supported. Zheng et al. [31]
proposed indexing the spatial data on the server by a space-filling curve. The Hilbert
curve [16] was chosen for this purpose because of its superior locality. The index values
of the data packets represent the order in which these data packets are broadcast. For
example, the Hilbert curve in Fig. 3 tries grouping data of close values so that they can be
accessed within a short interval when they are broadcast sequentially. The MHs use on-
air search algorithms [31] to answer LBSQs (kNN and WQs) over data that arrives in the
order prescribed by the Hilbert curve.
We focus on two common types of spatial queries, namely, kNNqueries and WQs. With
R-tree-based [10] spatial indices, depth-first search (DFS) [25] and best first search
(BFS) [13] have been the prevalent branch-and-bound techniques for processing NN
queries. The DFS method recursively expands the index nodes for searching NN
candidates. At each newly visited nonleaf node, DFS computes the ordering metrics for
all its child nodes and applies pruning strategies to remove unnecessary branches. When a
leaf node is reached, the data objects are retrieved, and theNNcandidates are updated.
Comparatively, the BFS technique utilizes a priority queue to store nodes to be explored
through the search process. The nodes in the queue are sorted according to their
minimum distance (MINDIST) to the query point. During the search process, BFS
repeatedly dequeues the top entry in the queue and enquires its child nodes with their
MINDIST into the queue. When a data entry is dequeued, it is inserted into the result set.
For WQs that find objects within a specified area, the R-tree families [3], [26] provide
efficient access to disk-based databases. Basically, an R-tree structure groups objects
close to each other into a minimum bounding rectangle (MBR), and a range query only
visits MBRs that overlap with the query area.
• This System is a novel approach for reducing the spatial query access latency
by leveraging results from nearby peers in wireless broadcast environments.
• Our scheme allows a mobile client to locally verify whether candidate objects
received from peers are indeed part of its own spatial query result set.
• The method exhibits great scalability: the higher the mobile peer density, the
more the queries answered by peers.
• The query access latency can be decreased with the increase in clients.
3.3 System Requirement Specification
Software Interface
• JDK 1.5
• Java Swing
• SQL Server
Hardware Interface
3.4 Modules:
• Multiple peer simulation Module
• Server Module
• Sharing-based nearest neighbor query visualization Module
Java Technology
Java technology is both a programming language and a platform.
The Java Programming Language
The Java programming language is a high-level language that can be
characterized by all of the following buzzwords:
Simple
Architecture neutral
Object oriented
Portable
Distributed
High performance
Interpreted
Multithreaded
Robust
Dynamic
Secure
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-
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
illustrates how this works.
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 bytecode compilers can bring performance close to that of native code without
threatening portability.
From a programming perspective, the beauty of ODBC is that the application can
be written to use the same set of function calls to interface with any data source,
regardless of the database vendor. The source code of the application doesn’t change
whether it talks to Oracle or SQL Server. We only mention these two as an example.
There are ODBC drivers available for several dozen popular database systems. Even
Excel spreadsheets and plain text files can be turned into data sources. The operating
system uses the Registry information written by ODBC Administrator to determine
which low-level ODBC drivers are needed to talk to the data source (such as the interface
to Oracle or SQL Server). The loading of the ODBC drivers is transparent to the ODBC
application program. In a client/server environment, the ODBC API even handles many
of the network issues for the application programmer.
The advantages of this scheme are so numerous that you are probably thinking there must
be some catch. The only disadvantage of ODBC is that it isn’t as efficient as talking
directly to the native database interface. ODBC has had many detractors make the charge
that it is too slow. Microsoft has always claimed that the critical factor in performance is
the quality of the driver software that is used. In our humble opinion, this is true. The
availability of good ODBC drivers has improved a great deal recently. And anyway, the
criticism about performance is somewhat analogous to those who said that compilers
would never match the speed of pure assembly language. Maybe not, but the compiler (or
ODBC) gives you the opportunity to write cleaner programs, which means you finish
sooner. Meanwhile, computers get faster every year.
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.
JDBC Goals
Few software packages are designed without goals in mind. JDBC is one that,
because of its many goals, drove the development of the API. These goals, in conjunction
with early reviewer feedback, have finalized the JDBC class library into a solid
framework for building database applications in Java.
The goals that were set for JDBC are important. They will give you some insight
as to why certain classes and functionalities behave the way they do. The eight design
goals for JDBC are as follows:
1. SQL Level API
The designers felt that their main goal was to define a SQL interface for Java.
Although not the lowest database interface level possible, it is at a low enough level for
higher-level tools and APIs to be created. Conversely, it is at a high enough level for
application programmers to use it confidently. Attaining this goal allows for future tool
vendors to “generate” JDBC code and to hide many of JDBC’s complexities from the end
user.
2. SQL Conformance
SQL syntax varies as you move from database vendor to database vendor. In an effort to
support a wide variety of vendors, JDBC will allow any query statement to be passed
through it to the underlying database driver. This allows the connectivity module to
handle non-standard functionality in a manner that is suitable for its users.
3. JDBC must be implemental on top of common database interfaces
The JDBC SQL API must “sit” on top of other common SQL level APIs. This
goal allows JDBC to use existing ODBC level drivers by the use of a software
interface. This interface would translate JDBC calls to ODBC and vice versa.
4. Provide a Java interface that is consistent with the rest of the Java
system
Because of Java’s acceptance in the user community thus far, the designers feel that they
should not stray from the current design of the core Java system.
5. Keep it simple
This goal probably appears in all software design goal listings. JDBC is no exception.
Sun felt that the design of JDBC should be very simple, allowing for only one method of
completing a task per mechanism. Allowing duplicate functionality only serves to
confuse the users of the API.
6. Use strong, static typing wherever possible
Strong typing allows for more error checking to be done at compile time; also, less
error appear at runtime.
7. Keep the common cases simple
Because more often than not, the usual SQL calls used by the programmer are simple
SELECT’s, INSERT’s, DELETE’s and UPDATE’s, these queries should be simple to perform
with JDBC. However, more complex SQL statements should also be possible.
Networking
TCP/IP stack
IP datagram’s
TCP
In order to use a service, you must be able to find it. The Internet uses an address
scheme for machines so that they can be located. The address is a 32 bit integer which
gives the IP address. This encodes a network ID and more addressing. The network ID
falls into various classes according to the size of the network address.
Network address
Class A uses 8 bits for the network address with 24 bits left over for other
addressing. Class B uses 16 bit network addressing. Class C uses 24 bit network
addressing and class D uses all 32.
Subnet address
Host address
8 bits are finally used for host addresses within our subnet. This places a limit of
256 machines that can be on the subnet.
Total address
FIGURE 6 - IP ADDRESSING
The 32 bit address is usually written as 4 integers separated by dots.
Port addresses
A service exists on a host, and is identified by its port. This is a 16 bit number. To
send a message to a server, you send it to the port for that service of the host that it is
running on. This is not location transparency! Certain of these ports are "well known".
Sockets
#include <sys/types.h>
#include <sys/socket.h>
int socket(int family, int type, int protocol);
Here "family" will be AF_INET for IP communications, protocol will be zero, and type
will depend on whether TCP or UDP is used. Two processes wishing to communicate
over a network create a socket each. These are similar to two ends of a pipe - but the
actual pipe does not yet exist.
Chapter 4 – System Design
Module 1
Mobile Host1
Finding nearest
Neighbor
Mobile Host 2
Module 2
MH2
MH1 Server
MH3
d
lize MH4
a
entr rver
C Se
MH
3
MH
1 MH
2
MH-Mobile Host
Chapter 5 - Module Description
The multiple peer simulation modules concurrently model a predefined number of mobile
hosts. It implements all the functionality of a single mobile host and provides the
communication facilities among peers and from peers to remote spatial database servers.
The server module is responsible for storing points of interest indexed by an R-tree
structure. It performs NN queries from peers with pruning bounds and records the I/O
load and access frequency of the spatial database server.
The Query location and preferred criteria are the input for Mobile Host. The Mobile Host
gets the results for the corresponding location and criteria, with considerably reducing
latency while getting results from neighboring peers.
Chapter 6 – System Testing
TYPES OF TESTS
Unit testing
Unit testing involves the design of test cases that validate that the internal program
logic is functioning properly, and that program inputs produce valid outputs. All decision
branches and internal code flow should be validated. It is the testing of individual
software units of the application .it is done after the completion of an individual unit
before integration. This is a structural testing, that relies on knowledge of its construction
and is invasive. Unit tests perform basic tests at component level and test a specific
business process, application, and/or system configuration. Unit tests ensure that each
unique path of a business process performs accurately to the documented specifications
and contains clearly defined inputs and expected results.
Integration testing
Integration tests are designed to test integrated software components to determine
if they actually run as one program. Testing is event driven and is more concerned with
the basic outcome of screens or fields. Integration tests demonstrate that although the
components were individually satisfaction, as shown by successfully unit testing, the
combination of components is correct and consistent. Integration testing is specifically
aimed at exposing the problems that arise from the combination of components.
Functional test
System Test
System testing ensures that the entire integrated software system meets requirements.
It tests a configuration to ensure known and predictable results. An example of system
testing is the configuration oriented system integration test. System testing is based on
process descriptions and flows, emphasizing pre-driven process links and integration
points.
White Box Testing is a testing in which in which the software tester has
knowledge of the inner workings, structure and language of the software, or at least its
purpose. It is purpose. It is used to test areas that cannot be reached from a black box
level.
Black Box Testing is testing the software without any knowledge of the inner
workings, structure or language of the module being tested. Black box tests, as most other
kinds of tests, must be written from a definitive source document, such as specification or
requirements document, such as specification or requirements document. It is a testing in
which the software under test is treated, as a black box .you cannot “see” into it. The test
provides inputs and responds to outputs without considering how the software works.
Unit testing is usually conducted as part of a combined code and unit test phase of
the software lifecycle, although it is not uncommon for coding and unit testing to be
conducted as two distinct phases.
Test objectives
• All field entries must work properly.
• Pages must be activated from the identified link.
• The entry screen, messages and responses must not be delayed.
Features to be tested
• Verify that the entries are of the correct format
• No duplicate entries should be allowed
• All links should take the user to the correct page.
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
User Acceptance Testing is a critical phase of any project and requires significant
participation by the end user. It also ensures that the system meets the functional
requirements.
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
Chapter 7 – System Implementation
Advantages
Applications
Now a day this is used in mobile search application to get the approximate result
in short time instead of getting accurate results in long time.
CentralizedServer.java
import javax.swing.*;
import java.io.*;
import java.awt.*;
import java.sql.*;
import java.net.*;
//ServerSocket ss2;
ServerSocket ss3;
Socket s2,s3;
Socket s4,s6;
Socket s5;
Socket s7;
Socket s8;
Jdbc d = new Jdbc();
int Count = 1;
String[] send;
String[] send1;
String[] send2;
String portno;
String direction;
String distance;
String location;
String criteria;
String mh1;
String mh2;
String mh3;
ResultSet rs;
/** Creates new form CentralizedServer */
public CentralizedServer() {
initComponents();
setVisible(true);
setSize(1200,1000);
try {
ss3 = new ServerSocket(6666);
} catch (Exception e) {
e.printStackTrace();
}
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(null);
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jScrollPane1.setViewportView(jTextArea1);
getContentPane().add(jScrollPane1);
jScrollPane1.setBounds(330, 140, 160, 210);
jTextArea2.setColumns(20);
jTextArea2.setRows(5);
jScrollPane2.setViewportView(jTextArea2);
getContentPane().add(jScrollPane2);
jScrollPane2.setBounds(550, 140, 160, 210);
pack();
try {
s2 = ss2.accept();
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-
FIRST:event_jButton2ActionPerformed
// TODO add your handling code here:
try {
s3 = ss3.accept();
DataInputStream dis = new
DataInputStream(s3.getInputStream());
String dd11= dis.readUTF();
send = dd11.split("&");
jTextArea2.append("Query Details :"+"\n");
for (int i = 0; i < send.length; i++)
{
String string = send[i];
}
//System.out.println(send[0]+""+send[1]+""+send[2]);
d.insertServer("insert into Requested_Hosts
values('"+send[0]+"','"+send[1]+"','"+send[2]+"')");
jTextArea2.append(Count+"."+"Port
Number :"+send[0]+"\n");
location=send[1];
criteria=send[2];
jTextArea2.append("Location : "+send[1]+"\n");
jTextArea2.append("Criteria : "+send[2]+"\n");
Count++;
} catch (Exception e) {
e.printStackTrace();
}
}
jTextArea1.append(string1+"\t");
}
jTextArea1.append("\n");
} catch (Exception e) {
e.printStackTrace();
}
}
jTextArea1.append(string2+"\t");
}
jTextArea1.append("\n");
}
} catch (Exception e) {
e.printStackTrace();
}
}
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-
FIRST:event_jButton6ActionPerformed
// TODO add your handling code here:
String s0 = send[0];
String s1 = send[1];
String s2 = send[2];
JOptionPane.showMessageDialog(this,s0);
JOptionPane.showMessageDialog(this,s1);
JOptionPane.showMessageDialog(this,s2);
try {
if(s0.equals("1111"))
{
int PortNo = d.retrivePort("select Portno
from Query_Results where Location='"+send[1]+"'and Criteria='"+send[2]+"'");
System.out.println("Port Number:
"+PortNo);
s5 = new Socket(mh1,4444);
DataOutputStream doutport = new
DataOutputStream(s5.getOutputStream());
doutport.writeInt(PortNo);
}
else if(s0.equals("2222"))
{
int PortNo = d.retrivePort("select Portno
from Query_Results where Location='"+send[1]+"'and Criteria='"+send[2]+"'");
System.out.println("Port Number:
"+PortNo);
s5 = new Socket(mh2,4445);
DataOutputStream doutport = new
DataOutputStream(s5.getOutputStream());
doutport.writeInt(PortNo);
}
else if(s0.equals("3333"))
{
int PortNo = d.retrivePort("select Portno
from Query_Results where Location='"+send[1]+"'and Criteria='"+send[2]+"'");
System.out.println("Port Number:
"+PortNo);
s5 = new Socket(mh3,4446);
DataOutputStream doutport = new
DataOutputStream(s5.getOutputStream());
doutport.writeInt(PortNo);
}
}catch (Exception e) {
e.printStackTrace();
}
try
{
if(ser0.equals("1111"))
{
String fromServer = d.gettingResults("select Results from Query_Results
where Location = '"+ser1+"' and Criteria = '"+ser2+"' ");
DataOutputStream dosser = new
DataOutputStream(s3.getOutputStream());
dosser.writeUTF(fromServer);
}else if(ser0.equals("2222"))
{
String fromServer = d.gettingResults("select Results from Query_Results
where Location = '"+ser1+"' and Criteria = '"+ser2+"' ");
DataOutputStream dosser = new
DataOutputStream(s3.getOutputStream());
dosser.writeUTF(fromServer);
}else if(ser0.equals("3333"))
{
String fromServer = d.gettingResults("select Results from Query_Results
where Location = '"+ser1+"' and Criteria = '"+ser2+"' ");
DataOutputStream dosser = new
DataOutputStream(s3.getOutputStream());
dosser.writeUTF(fromServer);
}
}
catch (Exception er)
{
er.printStackTrace();
}
if(pno.equals(""))
{
JOptionPane.showMessageDialog(this,"Enter Port Number");
}
else if(qlc.equals(""))
{
JOptionPane.showMessageDialog(this,"Enter Query Location");
}
else if(cri.equals(""))
{
JOptionPane.showMessageDialog(this,"Enter criteria");
}
else if(rst.equals(""))
{
JOptionPane.showMessageDialog(this,"Enter Results");
}
else if(jButton6!=null)
{
String bu6mess = "Do You Want Save in Database?";
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
System.exit(0);
}
new CentralizedServer();
JDBC.java:
import javax.swing.*;
import java.io.*;
import java.awt.*;
import java.sql.*;
class Jdbc
{
// insert Client Method Calls
public String insertClient(String query)
{
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:Mobile","sa","");
Statement st = con.createStatement();
st.executeUpdate(query);
} catch (Exception e) {
System.out.println("Connection Not Found"+e);
}
return "";
}
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con =
DriverManager.getConnection("jdbc:odbc:MobileServer","sa","");
Statement st = con.createStatement();
st.executeUpdate(query);
} catch (Exception e) {
System.out.println("Connection Not Found"+e);
}
return "";
}
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con =
DriverManager.getConnection("jdbc:odbc:MobileServer","sa","");
Statement st = con.createStatement();
ResultSet rs = st.executeQuery(query);
while(rs.next())
{
values += rs.getString("Portno")+"%"+;
}
} catch (Exception e) {
e.printStackTrace();
}
return values;
}
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con =
DriverManager.getConnection("jdbc:odbc:MobileServer","sa","");
Statement st = con.createStatement();
ResultSet rs = st.executeQuery(query);
while(rs.next())
{
rsts += rs.getString("Portno")+"%"+ rs.getString("Location")
+"%"+rs.getString("Criteria")+"%"+rs.getString("Results")+"&";
}
} catch (Exception e) {
e.printStackTrace();
}
return rsts;
}
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:Mobile","sa","");
Statement st = con.createStatement();
ResultSet rs = st.executeQuery(query);
while(rs.next())
{
finalrst += rs.getString(1);
}
} catch (Exception e) {
e.printStackTrace();
}
return finalrst;
}
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con =
DriverManager.getConnection("jdbc:odbc:MobileServer","sa","");
Statement st = con.createStatement();
ResultSet rs=st.executeQuery(query);
while(rs.next())
{
searchResults=rs.getInt(1);
}
System.out.println(searchResults);
} catch (Exception e) {
e.printStackTrace();
}
return searchResults;
}
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con =
DriverManager.getConnection("jdbc:odbc:MobileServer","sa","");
Statement st = con.createStatement();
ResultSet rs = st.executeQuery(query);
if(rs.next()==true)
{
port+= rs.getInt(1);
JOptionPane jp=new JOptionPane();
jp.showMessageDialog(jp,"Port Number : "+port);
} catch (Exception e) {
e.printStackTrace();
}
return port;
}
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:Mobile","sa","");
Statement st = con.createStatement();
ResultSet rs = st.executeQuery(query);
while(rs.next())
{
rst1 += rs.getString("Results");
JOptionPane jp=new JOptionPane();
jp.showConfirmDialog(jp,"Do You Want Send Query To Nearest
MobileHost");
} catch (Exception e) {
e.printStackTrace();
}
return rst1;
}
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con =
DriverManager.getConnection("jdbc:odbc:MobileServer","sa","");
Statement st = con.createStatement();
ResultSet rs=st.executeQuery(query);
while(rs.next())
{
onlyServer=rs.getString("Results");
}
System.out.println(onlyServer);
} catch (Exception e) {
e.printStackTrace();
}
return onlyServer;
}
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con =
DriverManager.getConnection("jdbc:odbc:MobileServer","sa","");
Statement st = con.createStatement();
ResultSet rs=st.executeQuery(query);
while(rs.next())
{
rtnport=rs.getString("Portno");
}
System.out.println(rtnport);
} catch (Exception e) {
e.printStackTrace();
}
return rtnport;
}
}
Chapter 8 – Conclusion & Future Enhancement
This paper presented a novel approach for reducing the spatial query access latency by
leveraging results from nearby peers in wireless broadcast environments. Significantly,
our scheme allows a mobile client to locally verify whether candidate objects received
from peers are indeed part of its own spatial query result set. The experiment results
indicate that our method can reduce the access to the wireless broadcast channel by a
significant amount, for example, up to 80 percent, in a dense urban area. This is achieved
with minimal caching at the peers. By virtue of its P2P architecture, the method exhibits
great scalability: the higher the mobile peer density, the more the queries answered by
peers. Therefore, the query access latency can be markedly decreased with the increase in
clients.
Screenshots
References
[1] S. Acharya, R. Alonso, M.J. Franklin, and S.B. Zdonik, “Broadcast Disks: Data
Management for Asymmetric Communications Environments,” Proc. ACM SIGMOD
’95, pp. 199-210, 1995.
[4] J. Broch, D.A. Maltz, D.B. Johnson, Y.-C. Hu, and J.G. Jetcheva, “A Performance
Comparison of Multi-Hop Wireless Ad Hoc Network Routing Protocols,” Proc. ACM
MobiCom ’98, pp. 85-97, 1998.
[7] C.-Y. Chow, H. Va Leong, and A.T.S. Chan, “Distributed Group- Based Cooperative
Caching in a Mobile Broadcast Environment,” Mobile Data Management, pp. 97-106,
2005.
[8] M. de Berg, M. van Kreveld, M. Overmars, and O. Schwarzkopf, Computational
Geometry Algorithms and Applications, second ed. Springer, 2000.
[9] G. Gaertner and V. Cahill, “Understanding Link Quality in 802.11 Mobile Ad Hoc
Networks,” IEEE Internet Computing, vol. 8, no. 1, pp. 55-60, 2004.
[10] A. Guttman, “R-Trees: A Dynamic Index Structure for Spatial Searching,” Proc.
ACM SIGMOD ’84, pp. 47-57, June 1984.
[12] T. Hara and S.K. Madria, “Data Replication for Improving Data Accessibility in Ad
Hoc Networks,” IEEE Trans. Mobile Computing, vol. 5, no. 11, pp. 1515-1532, Nov.
2006.
[13] G.R. Hjaltason and H. Samet, “Distance Browsing in Spatial Databases,” ACM
Trans. Database Systems, vol. 24, no. 2, pp. 265-318, 1999.