Connecting to a database with ColdFusion
About dynamic content
In the early days of the web, most websites were just repositories of static information. As the web has grown in capacity, however, it has also grown in capability. Today organizations want to do more with their websites, such as provide customized information for users and allow people to conduct commercial transactions. These capabilities require dynamic web pages.
Static web pages
Simple web applications deliver static pages. As the term implies, content on static pages does not change. A developer creates a static page and puts it on a server where a user can request it. The components of a static page, such as text, images, and other embedded objects, are present in the code of the page, and change only when a developer manually modifies the page. Static pages are processed as follows (see Figure 1):
- A user requests the page by typing its URL in a browser.
- The browser requests the page from the web server.
- The web server locates the page and sends it to the browser in the form of HTML.
- The browser interprets the HTML and displays the page to the user.
Figure 1. Process for static web pages
Dynamic web pages
In many cases, a web page must be able to deliver content that changes, either over time or by a user. For example, the following scenarios require dynamic processing:
- User wants the latest stock quotes and needs up-to-the-minute information
- User purchasing items from a website needs information that is specific to her
- Customer browsing a catalog needs updated information stored within a database
Dynamic page processing is similar to static page processing, but includes some additional steps (see Figure 2):
- A user requests the page by typing its URL in a browser.
- The browser requests the page from the web server.
- The web server processes the unique page extension and passes the request on to an application server for processing.
- The application server processes the request and outputs some data in the form of HTML back to the web server. (For example, the dynamic web page may instruct the application server to extract data from a database and insert it into the page's HTML.)
- The web server sends the resulting HTML page to the browser.
- The browser interprets the HTML and displays the page to the user.

Figure 2. Dynamic web page process