Course Content Web Technologies and Applications • Introduction • Databases & WWW • Internet and WWW • SGML / XML Winter 2001 • Protocols • Managing servers • HTML and beyond • Search Engines CMPUT 499: DBMS and WWW • Animation & WWW • Web Mining • Java Script • CORBA Dr. Osmar R. Zaïane • Dynamic Pages • Security Issues • Perl Intro. • Selected Topics • Java Applets • Projects University of Alberta Dr. Osmar R. Zaïane, 2001 Dr. Osmar R. Zaïane, 2001 Web Technologies and Applications University of Alberta 1 Web Technologies and Applications University of Alberta 2 2 Outline of Lecture 10 Objectives of Lecture 10 • Introduction DBMS & WWW DBMS & WWW • Off-line access to databases • Students will be able to understand the • Static and dynamic Web pages different current methods used to access • SQL embedded in HTML (server side includes) databases on the Web. • CGI and servlet solution to database gateways • Introduce the basic database access • Internet database connector: Microsoft solution techniques. • JDBC: databases the Java way • Understand the benefits and trade-offs for • Solutions from database vendors each technique • Association Rule Mining Dr. Osmar R. Zaïane, 2001 Dr. Osmar R. Zaïane, 2001 3 4 Web Technologies and Applications University of Alberta Web Technologies and Applications University of Alberta
Introduction HTTP Client-Server Architecture Motivation • WWW • Databases - user friendly - structured and organized Request - popular - secure/ reliable - accessible - most up-to-date information Server Client - cost effective - scalable - high availability H Answer T M - automatic recovery L - data integrity Dr. Osmar R. Zaïane, 2001 Dr. Osmar R. Zaïane, 2001 Web Technologies and Applications University of Alberta 5 Web Technologies and Applications University of Alberta 6 HTTP Client-Server Architecture Database Client-Server Architecture Stateless Session Authentication Open connection Request H Requests Client Server Database Answers Server Client Close connection H H Answer T User M User status is “remembered” during L Status a session. HTTP Response header Dr. Osmar R. Zaïane, 2001 Dr. Osmar R. Zaïane, 2001 7 8 Web Technologies and Applications University of Alberta Web Technologies and Applications University of Alberta
Outline of Lecture 10 Simulation of status in stateless session • Introduction • Off-line access to databases State information (cookies or hidden variables) • Static and dynamic Web pages Request H • SQL embedded in HTML (server side includes) • CGI and servlet solution to database gateways Server Client • Internet database connector: Microsoft solution • JDBC: databases the Java way H Answer H • Solutions from database vendors T M L • Association Rule Mining State information Dr. Osmar R. Zaïane, 2001 Dr. Osmar R. Zaïane, 2001 Web Technologies and Applications University of Alberta 9 Web Technologies and Applications University of Alberta 10 Off-line access to databases Off-line access to databases • Periodically extract data from database and generate static pages based on common 2 usage and requests 3 Client Request Server 1 HTML Database 4 Access Generate Answer • Navigation between pages is done through static links generated in the HTML pages Dr. Osmar R. Zaïane, 2001 Dr. Osmar R. Zaïane, 2001 11 12 Web Technologies and Applications University of Alberta Web Technologies and Applications University of Alberta
Outline of Lecture 10 Off-line access to databases • Introduction • Off-line access to databases • Can be indexed by search engines • Static and dynamic Web pages • Easy to implement • SQL embedded in HTML (server side includes) • Can be cached by client and accessed off-line • CGI and servlet solution to database gateways • Internet database connector: Microsoft solution • Limited navigation • JDBC: databases the Java way • Can not access data unless page has been • Solutions from database vendors generated • Association Rule Mining • Data not up-to-date Dr. Osmar R. Zaïane, 2001 Dr. Osmar R. Zaïane, 2001 Web Technologies and Applications University of Alberta 13 Web Technologies and Applications University of Alberta 14 Outline of Lecture 10 Static vs. Dynamic • Introduction • Off-line access to databases • Static and dynamic Web pages Request Request • SQL embedded in HTML (server side includes) Client Server Client Server Fetch HTML Generate • CGI and servlet solution to database gateways Fetch Answer Answer HTML • Internet database connector: Microsoft solution An HTML document stored in a A dynamic Web page is • JDBC: databases the Java way file is a static Web page. Unless generated or partially generated • Solutions from database vendors the file is edited, its content does each time it is accessed. not change. • Association Rule Mining Dr. Osmar R. Zaïane, 2001 Dr. Osmar R. Zaïane, 2001 15 16 Web Technologies and Applications University of Alberta Web Technologies and Applications University of Alberta
Server Side Includes Server Side Includes • Results generated on the fly A server side include is a simple HTML-like tag. The Web server parses HTML files and replaces the included tags • Pages easy to maintain with their value or output in the HTML file. • Personalized pages for each user <HTML> <HEAD> <!--#INCLUDE FILE=“file”--> <TITLE> My Page</TITLE> </HEAD> <BODY> <!--#EXEC CMD=“todo.exe”--> • All files need to be parsed <H1>My Home Page</H1> <P> • Slow <!--#ECHO VAR=“DATE_LOCAL”> <!--# include file=“top_menu”--> <p> </BODY></HTML> Dr. Osmar R. Zaïane, 2001 Dr. Osmar R. Zaïane, 2001 Web Technologies and Applications University of Alberta 17 Web Technologies and Applications University of Alberta 18 Outline of Lecture 10 SQL database connectivity using server side includes • Introduction • Off-line access to databases • W3-msql (Hughes Technologies) • Static and dynamic Web pages • <! msql connect www.cs.sfu.ca> • <! msql database students> • SQL embedded in HTML (server side includes) • <! msql query “select studid, name, firstname from students” q1> • CGI and servlet solution to database gateways • <! msql print “Student:@q1.0 Name: @q1.2 @q1.1<br>“> • <! msql fetch q1> • Internet database connector: Microsoft solution • <! msql free q1> • JDBC: databases the Java way • CompuServe Internet Office Webserver • Solutions from database vendors • <!--#SQL SQL=“select studid, firstname, name from students” format=“Student: %s Name: %s %s”--> • Association Rule Mining • Connectivity to miniSQL, Sybase, Oracle, Informix and any ODBC compliant Dr. Osmar R. Zaïane, 2001 Dr. Osmar R. Zaïane, 2001 19 20 Web Technologies and Applications University of Alberta Web Technologies and Applications University of Alberta
Common Gateway Interface Common Gateway Interface CGI is a set of specification for passing information between a client Web browser, a Web server and an application (CGI • Client sends request (GET or POST) application). • Server receives request (name of CGI + data) • Filling out an HTML form • Server launches CGI application and passes • Clicking on a link in an HTML page request to it by means of environment variables Request + Data Data • CGI application returns data to server (STDOUT). Web CGI First line contains the MIME content-type Client H Server Application T M H L • Server adds standard HTTP header and returns T M L Answer data to client. processes data & generates HTML Dr. Osmar R. Zaïane, 2001 Dr. Osmar R. Zaïane, 2001 Web Technologies and Applications University of Alberta 21 Web Technologies and Applications University of Alberta 22 Common Gateway Interface Common Gateway Interface Request + Data • Executed on the server Data Web CGI Client Database • Implemented in any programming or scripting H Server Application T M H language L T M L Answer • Started by server upon client request processes data & generates HTML • Generated HTML are not indexed by search engines • New application process for each request • Embed SQL in CGI application to access database • Use hidden state information and user supplied data to build • Does not scale well because of the overhead of database queries spawning new application process for each request • Generate HTML based on query results Dr. Osmar R. Zaïane, 2001 Dr. Osmar R. Zaïane, 2001 23 24 Web Technologies and Applications University of Alberta Web Technologies and Applications University of Alberta
Recommend
More recommend