An application server lets you work with server-side resources such as databases.
For example, a dynamic page may instruct the application server to extract data
from a database and insert it into the page’s HTML. For more information, see
Beginner’s Guide to Databases. The instruction to extract data from a database
is called a database query. A query consists of search criteria expressed in
a database language called SQL (Structured Query Language). The SQL query is
written into the page’s server-side scripts or tags. An application server cannot
communicate directly with a database because the database’s proprietary format
renders the data undecipherable in much the same way that a Word document opened
in Notepad is undecipherable. The application server can communicate only through
the intermediary of a database driver. A database driver is software that acts
like an interpreter between the application server and the database. After the
driver establishes communication, the query is executed against the database
and a recordset is created. A recordset is a subset of data extracted from one
or more tables in a database. The recordset is returned to the application server
and the data used in the dynamic page. Here’s a simple database query written
in SQL: SELECT lastname, firstname, fitpoints FROM employees This statement
creates a three-column recordset and fills it with rows containing the last
name, first name, and fitness points of all employees in the database. For more
information, see SQL Primer. Here’s an illustration of the process of querying
a database and returning data to the browser:
Accessing a database An application server lets you work with server-side resources
such as databases. For example, a dynamic page may instruct the application
server to extract data from a database and insert it into the page’s HTML. For
more information, see Beginner’s Guide to Databases. The instruction to extract
data from a database is called a database query. A query consists of search
criteria expressed in a database language called SQL (Structured Query Language).
The SQL query is written into the page’s server-side scripts or tags. An application
server cannot communicate directly with a database because the database’s proprietary
format renders the data undecipherable in much the same way that a Word document
opened in Notepad is undecipherable. The application server can communicate
only through the intermediary of a database driver. A database driver is software
that acts like an interpreter between the application server and the database.
After the driver establishes communication, the query is executed against the
database and a recordset is created. A recordset is a subset of data extracted
from one or more tables in a database. The recordset is returned to the application
server and the data used in the dynamic page. Here’s a simple database query
written in SQL: SELECT lastname, firstname, fitpoints FROM employees This statement
creates a three-column recordset and fills it with rows containing the last
name, first name, and fitness points of all employees in the database. For more
information, see SQL Primer. Here’s an illustration of the process of querying
a database and returning data to the browser:
You can use almost any database with your web application, as long as you have the appropriate database driver for it. If you plan to build small low-cost applications, you can use a file-based database, such as one created in Microsoft Access. If you plan to build robust, business-critical applications, you can use a server-based database, such as one created in Microsoft SQL Server, Oracle 9i, or MySQL. If your database is located on a system other than your web server, make sure you have a fast connection between the two systems so that your web application can operate quickly and efficiently.
1 2 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 422