Configuring Data Sources
In ColdFusion, the term data source refers to a connection between ColdFusion and an information source, such as a database, LDAP server, flat file, etc. This chapter focuses on connecting with one specific type of data source: databases. Before you can use ColdFusion to interact with a database, the database has to be set up as a data source that the ColdFusion server can recognize. Unlike previous version of ColdFusion, which used ODBC, OLEDB, and native drivers to connect to databases, ColdFusion MX handles all database connections via JDBC (Java Database Connectivity). There are currently four distinct types of JDBC drivers, appropriately named type 1, 2, 3, and 4. Each JDBC type works in a slightly different way:
- JDBC to ODBC Bridge (Type 1)
JDBC calls are translated to appropriate ODBC calls and sent through an ODBC driver.
- Native-API Partly Java Technology-Enabled Driver (Type 2)
A JDBC call is converted to a client-specific API call.
- Net-Protocol Fully Java Technology-Enabled Driver (Type 3)
A JDBC call is first translated to an independent net protocol, then to a database-specific call.
- Native-Protocol Fully Java Technology-Enabled Driver (Type 4 )
A JDBC call is converted to the network protocol used by the specific database.
ColdFusion MX comes with JDBC drivers for connecting to several popular databases. Depending on the version of ColdFusion MX you have, drivers may include MS Access, MS SQL Server, Oracle, various flavors of DB2, Informix, ...