Download presentation
Presentation is loading. Please wait.
Published byBeryl Moody Modified over 9 years ago
9
DBLP database DBLP Web Site & Search Pages User Query Info n User Knowledge Info1 Info2 1. 2. 3.
11
DBLP database Multiple Authors List Page (Unique Author Data Page)
12
Multiple Authors List Page Hyperlinks to individual data pages
13
Main Author Home Page Table Data
14
DBLP database Multiple Authors List Page (Unique Author Data Page)
15
Unique Author Data Page
16
Overview of the Java SQL Wrapper Class SQL String 1. User inputs SQL Parser Sigmod Author & Title Search Web pages HTML Author & Title Parsers Oracle … (Single Title) data… data... … (Single Title) data… data... … (Single Title) data… data... … (Single Title) data… data... … (Single Title) data… data... (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
17
SQL Parser Name = Alice This_String_Skipped Title = Ways to.. This_String_Skipped Alice Ways to.. Name = Alice Sigmod Author Search page Sigmod Title Search page 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)
18
Sigmod Author Search page Sigmod Title Search page Single Author or List Page … (Single Title) data… data... Parse Title Parse Author Parse List 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
19
Multiple Author List page Sigmod Author Search page … Author1 Author2... … (Single Author) data… data... Parse Author Parse List Author1 Author2 Author3 Single Author Data page … (Single Author) data… data... Parse List Vector of Authors … (Single Author1) data… data... … (Single Author2) data… data... … (Single Author3) data… data... Parse Author OR Sigmod Title Search page … (Single Title) data… data... Parse Title B.2
20
Parse Author Parse Title Title: Public: Page: Results Vector: Tags & Values 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 article values (automatic id, ?, ?, ?)” Prepared Piped SQL Statements (Query Oracle for Author & Article IDs) C
21
RMI SQLWrapper Class Client 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*// AuthIDName Alice..87219 Joe Sl..53882 D QueryDB Method
22
Overview of the Java SQL Wrapper Class SQL String 1. User inputs SQL Parser Sigmod Author & Title Search Web pages HTML Author & Title Parsers Oracle … (Single Title) data… data... … (Single Title) data… data... … (Single Title) data… data... … (Single Title) data… data... … (Single Title) data… data... (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
23
ParseAuthor.jjt ParseList.java Oracle Client Browser Java Applet WrapperExp.html …. …... DBDescript.html …. …... Personal Web Server (Scarlet.wpi.edu) Index.html …. …... Java Server RMI HTTP SQLWrapper.java..sendSQL()..queryDB() Project Architecture Overview The Wrapper Class
24
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)
25
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
26
RMI Nitty-Gritties (or: Write--Compile--Run) From Command Line: Javac myRestaurant.java Rmic myRestaurant Generates Stubs & Skeletons Compiles Source Code to Create Executable Class Files
27
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
28
Cookies import netscape.javascript.*; init(){ QueryApplet.java Index.html … javaScript Function setCookie Function getCookie Function delCookie Function returnTime … <Applet code=QueryApplet.class... MAYSCRIPT>... QueryServer.java saveToList(string cookie..) … deleteFunction (string cookie..)... getSavedList (string cookie..)... RMI ClientQueries (Folder) JSObject method calls Cookie1.txt Cookie2.txt Cookie3.txt CookieCode.………. ….…..CookieCode …} Local File I/O
29
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 Code Cookie String (Applet Global Variable) = local_host_name (from static method) + TimeStamp (from JavaScript returnTime )
30
Swing Tables JTable JComponent TableModel Listener TableColumn ModelListener ListSelection Listener TableModel Abstract TableModel Default TableModel CustomModel ListSelection Model DefaultList SelectionModel Table ColumnModel DefaultTable ColumnModel
31
The End
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.