dblp database dblp web site & search pages user query info n user knowledge info1 info2 1. 2. 3
TRANSCRIPT
DBLPdatabase
DBLPWeb Site
& Search Pages
User Query
Info n
UserKnowledgeInfo1Info2
1.
2.
3.
DBLPdatabase
MultipleAuthorsList Page
(Unique Author
Data Page)
Multiple AuthorsList Page
Hyperlinks to individual data pages
Main Author
Home Page
Table Data
DBLPdatabase
MultipleAuthorsList Page
(Unique Author
Data Page)
Unique AuthorData Page
Overview of the Java SQL Wrapper Class
SQL String
1. User inputs
SQL Parser
SigmodAuthor & Title
Search Web pages
HTMLAuthor &
Title Parsers
Oracle
<HTML>…(Single Title)<TD>data…data</TD>
...</HTML>
<HTML>…(Single Title)<TD>data…
data</TD … … >...</HTML>
<HTML>…(Single Title)<TD>data…
data</TD … … >...</HTML>
<HTML>…(Single Title)<TD>data…
data</TD … … >...</HTML>
<HTML>…(Single Title)<TD>data…
data</TD … … >...</HTML>
(Store Articles Method)2. Send SQL Method Builds a database for the query in Oracle
3. Query sent to Oracle
A
B
C
(QueryDB Method)D
SQL Parser
<SUBMIT> Name = AliceThis_String_Skipped
<SUBMIT> Title = Ways to..This_String_SkippedThis_String_Skipped
Alice
Ways to..
<SUMIT> Name = Alice
SigmodAuthorSearchpage
SigmodTitle
Searchpage
The SQL Query is parsed, and requests for Author and Title views are sent to the respective web pages.
The web pages return streams of HTML which are then parsed to extract the data.
A
(HTML to Parsers)(SQL from user)
SigmodAuthorSearchpage
SigmodTitle
Searchpage
Single Authoror
List Page
<HTML>…(Single Title)<TD>data…data</TD>
...</HTML>
ParseTitle
ParseAuthor
ParseList
The HTML returned from querying Search Author depends on whether the
requested name is unique in the database.
If it is unique, an HTML page with data about that author is returned. Otherwise a
list of hyperlinks to matching author names is returned.
Parse List determines what kind of page has been returned then if it is a list page,
extracts each of the author URLs and returns a vector of input streams to each of
those authors pages.
(to Oracle DB)
(Keyword queries
from SQL Parser)
(Zoom)
B.1
Multiple Author List page
SigmodAuthorSearchpage
<HTML>…
<LI> Author1</LI><LI>Author2</LI>
...</HTML>
<HTML>…(Single Author)
<TD>data…data</TD>
...</HTML>
ParseAuthor
ParseList
Author1
Author2
Author3
Single Author Data page
<HTML>…(Single Author)
<TD>data…data</TD>
...</HTML>
ParseList
Vectorof
Authors
<HTML>…(Single Author1)
<TD>data…data</TD>
...</HTML>
<HTML>…(Single Author2)
<TD>data…data</TD>
...</HTML>
<HTML>…(Single Author3)
<TD>data…data</TD>
...</HTML>
ParseAuthor
OR
SigmodTitle
Searchpage
<HTML>…(Single Title)<TD>data…data</TD>
...</HTML>
ParseTitle
B.2
ParseAuthor
ParseTitle
Title:
Public:
Page:
Results Vector:Tags & Values
Author:
Author:
Author:
Results Vector:Tags & Values
Alice Kent
Joe Stevens
Kim Lee
Databases
ICDE 1999
287
Oracle
Store Articles Method
“Insert into author values
(automatic id, ?, ?)”
“Insert into rel values
(select author_id..)”
“Insert into articlevalues
(automatic id, ?, ?, ?)”
Prepared Piped SQL Statements
(Query Oracle for Author & Article IDs)
C
RMI
SQLWrapper ClassClient Browser
Java Applet
Original SQL String Oracle
...connection.prepareStatement (SQL);
...rs = stmt.executeQuery ();
QueryDB Method
//*iterates through records in rs to build a String [ ][ ]
containing the resulting data*//
AuthID Name
Alice..87219Joe Sl..53882
D QueryDB Method
Overview of the Java SQL Wrapper Class
SQL String
1. User inputs
SQL Parser
SigmodAuthor & Title
Search Web pages
HTMLAuthor &
Title Parsers
Oracle
<HTML>…(Single Title)<TD>data…data</TD>
...</HTML>
<HTML>…(Single Title)<TD>data…
data</TD … … >...</HTML>
<HTML>…(Single Title)<TD>data…
data</TD … … >...</HTML>
<HTML>…(Single Title)<TD>data…
data</TD … … >...</HTML>
<HTML>…(Single Title)<TD>data…
data</TD … … >...</HTML>
(Store Articles Method)2. Send SQL Method Builds a database for the query in Oracle
3. Query sent to Oracle
A
B
C
(QueryDB Method)D
ParseAuthor.jjt
ParseList.java
Oracle
Client Browser
Java Applet
WrapperExp.html<HTML>….
…...
...</HTML>
DBDescript.html<HTML>….
…...
...</HTML>
Personal Web Server(Scarlet.wpi.edu)
Index.html<HTML>….
…...
...</HTML>
Java Server
RMI
HTTP
SQLWrapper.java
..sendSQL()
..queryDB()
Project Architecture Overview
The Wra
pper C
lass
The Diner
(Client
Application)
The Head Chef(Server
Application)
Dining Guide(Registry)
Servants & Waiters(Rmic Stubs & Skeletons)
The Menu(Interface)
Intuitive RMI
Naming.lookup(what restaurants) Reg.rebind(“CatchyName”, myRestaurant)
(Implements)
RMI Nitty-Gritties (or: Write--Compile--Run)
Html & Java Source Files(4):*Remote Interface
*Remote Object Server *Client Applet
*HTML page to load Applet
-Be Public -Extend java.rmi.Remote -Throw java.rmi.RemoteException
Must:
-Be Serializable -Implement 1(+) Remote Interfaces -Extend java.rmi.UnicastRemoteObject
(or export object explicitly) -Create & install a Security Manager -Create & Register 1(+) Remote Object
RMI Nitty-Gritties (or: Write--Compile--Run)
From Command Line:
Javac myRestaurant.java
Rmic myRestaurantGenerates Stubs
& Skeletons
Compiles Source Codeto Create Executable
Class Files
RMI Nitty-Gritties (or: Write--Compile--Run)
From Command Line:
Start RmiRegistry [port#]
Java myRestaurant
Load Applet in Browser
Starts Registry on port#or 1099 by default
Runs Java Server application
Cookies
import netscape.javascript.*;init(){
QueryApplet.java
Index.html<HTML>…
<HEAD> javaScript Function setCookie Function getCookie Function delCookie
Function returnTime</HEAD>
…<Applet code=QueryApplet.class
... MAYSCRIPT></Applet>
...</HTML>
QueryServer.java
saveToList(string cookie..)…
deleteFunction (string cookie..)...
getSavedList (string cookie..)...
RMI
ClientQueries(Folder)
JSObjectmethod calls
Cookie1.txt
Cookie2.txt
Cookie3.txt
CookieCode.……….….…..CookieCode
…}
LocalFile I/O
String cookie;try {cookie = InetAddress.getLocalHost().toString();}
catch(UnknownHostException uhe){cookie = "Unknown Host";} if ( cookie.indexOf("/") != -1 )
cookie = cookie.substring(0, cookie.indexOf('/'));
JSObject win = JSObject.getWindow(this); JSObject doc = (JSObject) win.getMember("document");
Object [] Arg = {"client"}; String ClientCookie = (String) win.call("getCookie", Arg);
if (ClientCookie.equals("undefined")) { String time = (String) win.call("returnTime", null);
int begin = time.indexOf(',') + 1; int end = time.indexOf('U')-1;
time = time.substring(begin, end); time = time.replace(' ', '_'); time = time.replace(':', '_');
time = cookie + time; Object [] Args = {"client", time , new Integer(30)};
win.call("setCookie", Args); cookie = (String) win.call("getCookie", Arg); }
else {cookie = ClientCookie;
Cookie CodeCookie String (Applet Global Variable)
= local_host_name (from static method) + TimeStamp (from JavaScript returnTime )
Swing Tables
JTable
JComponent TableModelListener
TableColumnModelListener
ListSelectionListener
TableModel
AbstractTableModel
DefaultTableModelCustomModel
ListSelectionModel
DefaultListSelectionModel
TableColumnModel
DefaultTableColumnModel
The End