IWMW 1997: Database-WWW Integration

26
16-17th July 1997 Running an Institutional Database-WWW Integration Brenda Lowndes Computing Services Department The University of Liverpool

Transcript of IWMW 1997: Database-WWW Integration

Page 1: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Database-WWW Integration

Brenda LowndesComputing Services Department

The University of Liverpool

Page 2: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Database-WWW Integration

• What is Database-WWW Integration?• Why integrate a database with the Web?• How is data integrated?• What tools are available?

Page 3: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

What is Database Integration?

• Using the information in a database to create Web pages

• Using a Web browser to access data in a database

Page 4: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Why Use a Database to Produce Web Pages?

• Institutional data is usually stored in a database.

• Data is being replicated in HTML pages– Duplication of data and effort– Inconsistencies in the data– Difficult to merge updates

• Web pages can be updated automatically whenever the database is updated

Page 5: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Why Use the Web to Access Data?• Familiar interface• Data can be integrated with other information

in an institution’s web pages • Platform and vendor independent front-end• Client machine does not need database

networking software • Information can be made available to anyone

on the Internet

Page 6: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

How is Data Accessed?

• Relational Databases– HTML pages are generated from the database

• statically• dynamically

– Java and JDBC downloaded and run on the client machine or on the server

• Library catalogues, Z39.50 servers, other free text search and retrieve

Page 7: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Static Access

• A program runs offline to produce the HTML pages

• Pages copied into web server directories• Can be automated and scheduled to run

– at specific times– triggered by a database update

Page 8: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Producing Static HTML Pages

• Any program that can access the database and output HTML– programming language and embedded SQL– report writers – database scripting language

• Database and Web development software provides a ‘Save as HTML’ option.

Page 9: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

When should you use Static Access?

• Non volatile data • Fixed or small number of pages• Predefined requests to the database

– No ad-hoc queries

Page 10: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Dynamic Access

• HTML pages are generated from the database when the page is requested

• Data always up to date• HTML forms can be used to define specific

data that is to be retrieved• Many different pages can be generated

Page 11: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Pages are created by:

• Running a simple program on the server which outputs HTML

• Extensions to the server which embed data extracted from the database into an HTML template file

• Server-side scripts which access the database and output HTML

Page 12: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Using a Program on the Server

• Typically a series of print statements that output the whole HTML page

• Usually run as a cgi program• Written using

– DBPerl– Embedded SQL – DBMS report writers– DBMS scripting language

Page 13: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Running a Program

HTMLCGIWeb Server

Page 14: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Running a Program

HTML

CGIWeb ServerDatabase Networking Software

Database Networking Software

Database ClientWeb Client

Page 15: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Running a Program

HTML

CGIWeb ServerODBC Driver

Database Networking Software

Database Networking Software

Page 16: IWMW 1997: Database-WWW Integration

Template Files• Template specifies

– where the database is– what data is required– what HTML is output

• Process can be server filter or extension, plug in or cgi script

Page 17: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

HTML Templates

HTMLServer ExtensionWeb Server

Database Networking Software

HTML Template

Page 18: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Internet Database Connectivity

• Microsoft’s IDC is an extension of their Internet Information Server

• Uses two files – .IDC file provides information about the

database and the SQL queries used– .HTX file provides the HTML template into

which the data from the database is embeddded

Page 19: IWMW 1997: Database-WWW Integration

•Advantages of Using Templates

• Pages easier to write than full programs• Requires only a knowledge of HTML and

how to specify an SQL query• Web development tools from Microsoft and

other suppliers often automate the process

Page 20: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Server-side Scripts

HTMLFilterWeb Server

Client/Server

VBScript

Java

PL/SQL

LiveHTML

Active Page

Page 21: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Stateless Connection

• Previous access methods do not maintain a session between the server and the database

• The client requests the data• The server

– connects to the database– produces the HTML– delivers the page to the client– disconnects from the database

Page 22: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Maintaining a Connection

• Many servers now can maintain a session between subsequent requests from the client

• These servers can maintain a connection to the database

• Can define a record set and scroll through records• Database connection can be closed by a request or

timed out after a defined period of inactivity or when the server is shut down

Page 23: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Java and JDBC

• JDBC is a Java API for executing SQL statements

• JDBC statements in a Java applet are used to access virtually any relational database

• The Java applet is downloaded to the client• The client establishes the connection with

the database server

Page 24: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Java and JDBC

Java Applet

Web Server Java Applet

Page 25: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

Java and JDBC

Java Applet

Web Server

Java Applet

Java JDBC

Java Applet

Page 26: IWMW 1997: Database-WWW Integration

16-17th July 1997 Running an Institutional Web Service

What Tools are Available?

See: http://www.liv.ac.uk/~qq48/publications/html/dbweb.html