Connecting Databases to the Web
Static v. Dynamic Web Applications
 | Static - data is in HTML pages, pages must be rebuilt and deployed for
updates. |
 | Dynamic - data is stored in database, application builds the web pages as
needed. |
Types of Applications
 | Search Engines |
 | E-commerce |
 | Large scale information delivery |
 | Examples: http://www.amazon.com, http://www.altavista.com |

Tools for Creating Web Database Applications
 | Can be as simple as text editor and appropriate web server configuration. |
 | Tools are often server-dependent |
 | Visual InterDev - Microsoft interactive Web development tool |
 | Oracle 8i - web database integration tools |
 | Allaire HomeSite and Microsoft FrontPage- can be used to create
server/client side projects |
 | Drumbeat |

Techniques for Connecting to Databases
 | ODBC |
 | OLE/DB |
 | Other techniques (depends on platform and database). |
ODBC
 | Open
Database Connectivity (ODBC) technology provides a common interface for
accessing heterogeneous SQL databases. |
 | ODBC is based on Structured Query Language (SQL) as a standard for
accessing data. This interface provides maximum interoperability: a single
application can access different SQL Database Management Systems (DBMS)
through a common set of code. |
 | It enables a developer to build and distribute a client/server application
without targeting a specific DBMS. |
 | Database
drivers are then added to link the application to the user's choice of DBMS. |
 | ODBC Applications are not tied to a proprietary vendor API. |
OLEDB Technology
 | Microsoft specification for integrating databases with applications
(including the web). |
 | It is built on Microsoft COM and is seen as both a complement and a
replacement for ODBC. |
 | Intended to be faster, more efficient, easier to maintain and use. |
 | Includes direct connectivity (C++, J++) and connectivity via ODBC. |

Web Architecture - Based on Standards
Browser
 | HTML standards |
 | Vendor implementations |
TCP/IP
 | Internet v. Intranet |
 | Bandwidth |
HTTP/HTTPS
 | Standards for implementation |
 | Platforms - UNIX, NT most common |
 | Implementations - Apache, IIS, Netscape |
CGI
 | Standard for HTTP communication with environment. |

Web/Database Architecture
Two Tier Model

Three Tier Model (Separate Database Server)

Web Forms and CGI (Common Gateway Interface)
Web Form - displays/presents the data.
 |
Basic set of controls for an interactive
interface |
 |
Text box, Radio Button, Check Box,
Button, List Box |
 |
Form is directed to a web
application/page. |
Post/Get - sends data from the browser to
the server.
 |
Post - sends as part of the Request data
stream (stdin/out) |
 |
Get - sends as part of the URL (www.acme.com/appname?param=value¶m2=value)
|
CGI Operation
 |
Depends on a programming interface
between application and web server. |
 |
Key aspects include input/output (data)
& server operations |
 |
Moves data between the web server and
the server-database application. |
 |
Provides server/environment
information to application |
 |
Can be used to maintain state
information |

Database Connections via Object
Technology (for Microsoft anyway)
 |
ActiveX Data
Objects = ADO |
 |
Integrates with ASP, Perl, Java, and
other web server technologies. |
 |
Components that allow you to connect to
and access a database. |
 |
Key objects: Connection, Recordset,
Error |
 |
Connection - identifies the
database, establishes a link (“database connection”). Is used to insert,
update, delete data from tables. |
 |
Recordset - holds the data –
handles the product of a select statement. |
 |
Error – identifies and tracks
errors during database interactions. |
|