![]() ![]() ![]() |
For ColdFusion developers, the term "data source" can refer to a number of different types of structured content accessible locally or across a network. You can query Web sites, LDAP servers, POP mail servers, and documents in a variety of formats.
Most commonly though, a database will drive your applications and in this section a data source is defined as the entry point for database operations.
ODBC is the standard interface for connecting to a data source from an application. The application must have an ODBC driver installed and configured for each data source. You can check your system's installed drivers by opening the ODBC Data Source Manager in the Windows Control Panel.
You can learn more about ODBC and download the ODBC 3.0 Programmer's Reference at http://www.microsoft.com/data/odbc/kill/download.htm.
You can install the Microsoft Data Access Components (MDAC 2.0) from the ColdFusion menu on the Windows Start menu. The installed set of ColdFusion ODBC drivers includes:
A thorough knowledge of databases is not necessary for developing a ColdFusion application that interacts with a database, but you will need to learn some basic concepts and techniques.
A database is a structure for storing units of information. Database management systems (DBMS) standardize the collection and maintenance of data and provide an interface for retrieving data.
The data in a database is organized in tables, which are collections of information about particular items. Those items can be individuals, products, or any entities that can be uniquely identified. A table consists of a grid of columns and rows. A column defines a unit of data such as a name, date, or zip code. Data is entered on each row under the appropriate column headings. A single row constitutes one data record because the data in that row applies to a unique item. Data can be organized in multiple tables to fill a wide range of user needs in an efficient manner. This type of data structure is known as a relational database and is the type used for all but the simplest data sets. The structure of a database is called the schema.
From this basic description, a few database design rules emerge. First, each record must contain a unique identifier, known as the primary key. This could be an employee ID, a part number, or a customer number. This is typically the column used to maintain each record's unique identity among the tables in a relational database. Second, once a column has been defined to contain a specific type of information, the data must be entered in that column in a consistent way. This is accomplished by defining a data type for the column, such as allowing only numeric values to be entered in the zip code column. Third, assessing user needs and incorporating those needs in the database design is essential to a successful implementation. A well-designed database accommodates the changing data needs within an organization.
For example, most companies maintain a database of their customers. At a minimum, this database contains columns (or fields) for information such as the customer's name, address, and phone number. Additional information on orders, payments, shipping instructions, and so on may be included as part of an order processing application. Sales information for each customer order can be stored and used to analyze sales trends and to determine sales commissions. How this data is organized is a function of the size and scope of the data itself and the complexity of the intended database operations.
The best way to familiarize yourself with the capabilities of your database product or DBMS is to review the product documentation.
![]() ![]() ![]() |
AllaireDoc@allaire.com
Copyright © 1998, Allaire Corporation. All rights reserved.