ColdFusion uses ODBC, OLE DB, and native database drivers to communicate with a wide variety of popular database programs. This section describes each type of driver so you can decide which best suits your needs.
Any valid ODBC data source already installed on your system is automatically available to your ColdFusion applications, but unless you register it as a ColdFusion data source, you can't configure it with ColdFusion-specific options, like the ability to specify SQL operations to restrict for the current data source.
When you create a data source on the Create ODBC Data Source page in the ColdFusion Administrator, you can configure a number of settings for your ODBC data source. The options available to you depend on which database driver you are using. Data source definitions and option settings are stored in the odbc.ini
file
. The main role of the odbc.ini
file is to map a data source name (DSN) to a particular ODBC driver and options.
For detailed information about options specific to your OBDC drivers, refer to the documentation that came with your database program or to the ODBC driver documentation, including help files that might have been copied to your system when you installed ODBC drivers. If you are running ColdFusion Server on a UNIX machine, refer to the MERANT ODBC documentation, which is distributed with ColdFusion as an Acrobat file. By default, it is installed as:
<installdir>/coldfusion/odbc/doc/odbchelp.pdf
The Enterprise edition of ColdFusion Server includes support for DB2, Informix, Sybase System 11, Sybase Adaptive Server 11.5, and Oracle 7.3 8.0, and 8i databases through native database drivers on both Windows NT and UNIX platforms. (See "Supported Databases" for a complete list of databases supported through both ODBC and native drivers.) You might consider using native database drivers because
Before you can use the ColdFusion native database drivers, you need to install additional client software. The following table details requirements for each database and each supported platform.
Software Requirements for Native Database Drivers | |
---|---|
Database | Client Software |
Oracle 7.3 | Oracle 7.3.x client |
Oracle 8.0 | Oracle 8.0 client |
Sybase System 11 Sybase Adaptive Server 11.5 | Sybase Open Client version 11.1.0 with Update 11.1.1 applied (Solaris and Windows NT) |
Informix 7.3 and 9 | Informix ESQL/C Informix-CLI |
IBM DB2 5.0/6.1 | IBM DB2 Client Application Enabler version 5 or 6 |
You must install the database client software and ColdFusion Server software on the same server. For more information about connecting to databases using ColdFusion native drivers, refer to the section for your particular database later in this chapter.
ColdFusion developers can now access a range of new data stores through Microsoft OLE DB, including:
Developers running ColdFusion Server on Windows NT who want to access Microsoft Access or SQL should especially consider using OLE DB instead of ODBC.
Before ColdFusion can use OLE DB to access data stores, you must install an OLE DB provider, available from third-party vendors. The provider software handles data processing in response to requests from the OLE DB consumer, in this case ColdFusion.
Performance gains can be made by running an OLE DB provider, instead of an ODBC driver, to process SQL. This depends on how the provider implements the data call. Some providers route OLE DB calls through the ODBC Driver Manager, while others go directly to the database. Providers that go directly to the database are akin to native drivers in providing an alternative to ODBC. Providers are available for all the major relational DBMS products as well as the data stores listed above.
ColdFusion server comes with a provider, Microsoft Data Access Components (MDAC) 2.1. MDAC 2.1 contains the ODBC/OLE DB subsystem as well as drivers for all Microsoft data types, including Access and SQL Server. After you install ColdFusion Server, you can install MDAC 2.1 from the ColdFusion Server Start menu by choosing Start > Programs > ColdFusion Server 4.5 > Install Microsoft Data Access Components.
Note | Before you install MDAC, stop all unnecessary services, such as web servers, virus scanning programs, or mail servers. |
You can confirm that OLE DB drivers are installed by searching for "Microsoft.Jet.OLEDB" in the registry using REGEDIT.EXE - if you find it, you likely have the proper driver installed.
OLE DB is a Microsoft specification. For more information, including a list of provider vendors, visit the Microsoft OLE DB site at http://www.microsoft.com/data/oledb/.