Adobe COLDFUSION 9 Manual page 407

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Accessing and Using Data
EmpID
Street
1
4 Main St.
2
10 Oak Dr.
3
15 Main St.
4
56 Maple Ln.
5
25 Elm St.
Addresses tables
In this example, each table contains a column named EmpID. This column associates a row of the employees table with
a row in the addresses table.
For example, to obtain all information about an employee, you request a row from the employees table and the row
from the addresses table with the same value for EmpID.
One advantage of using multiple tables is that you can add tables containing new information without modifying the
structure of your existing tables. For example, to add payroll information, you add a new table to the database where
the first column contains the employee's ID and the columns contain current salary, previous salary, bonus payment,
and 401(k) percent.
Also, an access to a small table is more efficient than an access to a large table. Therefore, if you update the street
address of an employee, you update only the addresses table, without having to access any other table in the database.
Database permissions
In many database environments, a database administrator defines the access privileges for users accessing the database,
usually through user name and password. When a person attempts to connect to a database, the database ensures that
the user name and password are valid and then imposes access requirements on the user.
Privileges can restrict user access so that a user can do the following:
• Read data.
• Read data and add rows.
• Read data, add rows, modify existing tables.
In ColdFusion, you use the ColdFusion Administrator to define database connections, called data sources. As part of
defining these connections, you specify the user name and password used by ColdFusion to connect to the database.
The database can then control access based on this user name and password.
For more information on creating a data source, see Configuring and Administering ColdFusion.
Commits, rollbacks, and transactions
Before you access data stored in a database, it is important to understand several database concepts, including:
• Commit
• Rollback
• Transactions
City
State
Newton
MA
Newton
MA
Newton
MA
Newton
MA
Newton
MA
Last updated 8/5/2010
Zip
02158
02161
02158
02160
02160
402

Advertisement

Table of Contents
loading

Table of Contents