Title: Putting Databases on the Internet
1Putting Databases on the Internet
- Brenda LowndesComputing Services Department
- The University of Liverpool
- England
2Overview
- Why put databases on the Internet?
- How is data published to the Web?
- What software is available?
3Databases on the Internet
- Information in a database used to create Web
pages - Web browsers used to view or update a database
4Using database to create Web pages
- Company data is usually stored in a database.
- Data replicated in HTML pages results in
- Duplication of data and effort
- Inconsistencies in the data
- Difficulties in merging updates
- Web pages automatically updated when database
updated
5Web browsers used to access data
- Familiar interface
- Data integrated with other information in
companys 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
6How is data accessed?
- HTML pages are generated from the database
- statically
- dynamically
- Java and JDBC
- run on the client
- run on the server
7Static pages
- 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
8When should you use static access?
- Non volatile data
- Fixed or small number of pages
- Predefined requests to the database
9Software for creating static 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 tools provide a
Save as HTML option
10Dynamic 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
11Creating pages dynamically
- Programs on the server access the database and
output HTML - Server extensions or filters embed data into
HTML template files - Server-side scripts access the database and
output HTML
12 Program on the server
- Print statements output the HTML page
- Usually run as a Common Gateway Interface (CGI)
program
13CGI Program
Web Server
CGI
Web Server
HTML
14Client Server
Web Server
CGI
HTML
Client/server Access
15Running a Program
CGI
Web Server
Database Networking Software
HTML
Database Client
Database Networking Software
16Client Server
Web Server
CGI
Web Server
Database Networking Software
HTML
Database Networking Software
Database Server
17Client Server
Web Server
CGI
Web Server
ODBC Driver
HTML
Database Networking Software
Database Networking Software
Database Server
18Software for creating dynamic pages
- DBPerl
- Embedded SQL
- Database report writers
- Database scripting languages
19Template files
- Template specifies
- database location
- what data is required
- what HTML is output
- Template is processed by a
- Server extension or filter
- Server plug-in
- CGI script
20Templates
Web Server
HTML Template
Server Extension
Web Server
HTML
Database Networking Software
Database Server
21Advantages of using templates
- Pages easier to write than programs
- Requires only a knowledge of
- HTML
- how to specify an SQL query
22Software
- Software usually written for specific server
extension - Web development tools automate the process
23Internet Database Connector
- Extension to Microsoft 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 embedded
24Producing IDC files
- Microsofts database products have wizards to
produce IDC/HTX files - Microsofts Web development software
- Frontpage
- Visual Interdev
- Web development tools from other suppliers will
also generate IDC/HTX files
25Software for producing IDC files
- Save as IDC/HTX option in Microsoft Access
- Microsoft Frontpage
- Microsoft Visual Interdev
- Software from other software vendors
26Server-side scripts
Web Server
Active Page
Filter
Web Server
HTML
Client/Server
Database Server
27Active Server Pages
- Microsoft Internet Information Server 3.0
- Server-side execution environment
- Can access any ODBC database
- Output is HTML- suitable for any browser
- Maintain a connection to the database
28Stateless Connection
- The client requests the data
- The server connects to the database
- produces the HTML
- delivers the page to the client
- disconnects from the database
29Maintaining a Connection
- Servers 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
30Client side 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
31Client side Java and JDBC
Web Server
Web Server
Java Applet
Java Applet
Java Applet
Database Server
32Server side Java and JDBC
- Java applet runs on the server
- JDBC driver on server maintains the connection
with the database server
33Server side Java and JDBC
Web Server
Web Server
Java Applet
Java Applet
Java JDBC
Java Applet
Database Server
34What Tools are Available?
- List of software at
- http//www.liv.ac.uk/qq48/publications/html/dbweb
.html