![]() ![]() ![]() |
||
|
One of the most commonly used and most powerful features of ColdFusion is the ability to connect to and manipulate data from a wide variety of databases. Like most ColdFusion developers, you will probably use this capability often. To be able to connect to a database, you must create a a data source in ColdFusion. A data source contains the information that ColdFusion needs to be able to recognize and communicate with a database.
ColdFusion MX 7 includes a Dreamweaver extension that lets you create a data source without having to leave the Dreamweaver environment. If you are not using Dreamweaver, you use the ColdFusion Administrator to create data sources; seeConfiguring a data source in the Administrator for more information.
To create a ColdFusion data source without leaving the Dreamweaver environment, you need the following information:
You can use the ColdFusion MX 7 Administrator to configure a data source. If you are running ColdFusion in a UNIX environment, you must use the ColdFusion MX 7 Administrator to connect to the PointBase database in the data source.
Note: If you are accessing the ColdFusion MX Administrator from a remote client, you must replace localhost with the host name or IP address of the computer where ColdFusion MX is installed.
The following sections describe how to establish a connection to the sample tutorial database file and how to enable optional debugging settings.
The following procedures describe how to configure a connection to the sample database file (CompassTravel) using the ColdFusion MX Administrator. Prior to building the sample application, you must configure the Compass Travel database connection.
Perform one of the following procedures. The Microsoft Access procedure is for Windows users. The PointBase procedure is for UNIX and Macintosh OS X users.
The ColdFusion MX Administrator verifies the data source connection and the name CompassTravel appears in the Connected Data Sources table.
If the connection to the CompassTravel data source fails, do the following:
The Add New Data Source dialog box appears.
Field |
Action |
---|---|
Data Source name text box |
Specify the name CompassTravel. Note: Ensure that the name of the data source file does not contain any spaces. If the name contains a space, the data source connection fails. |
Driver drop-down selection box |
Select Other. |
The Data Source dialog box appears.
Field |
Action |
---|---|
JDBC URL |
Enter the following JDBC URL for the Compass Travel PointBase files: jdbc:pointbase:compasstravel,database.home=/<home location>/wwwroot/cfdocs/getting_started/db The following is the default home location for stand-alone ColdFusion web server configurations: /opt/coldfusionmx7/wwwroot/cfdocs/getting_started/db |
Driver Class |
Enter the following driver class: com.pointbase.jdbc.jdbcUniversalDriver |
Driver Name |
Specify PointBase. |
Username |
Specify PBPUBLIC. |
Password |
Specify PBPUBLIC. |
Description |
Enter the following: Database file for Compass Travel tutorial |
Field |
Action |
---|---|
Maintain Connection |
Disabled (clear) |
CLOB |
Enabled (checked) |
BLOB |
Enabled (checked) |
The name CompassTravel appears in the Connected Data Sources dialog box.
OK appears in the Status column for successful connections.
If the connection to the compass travel data source fails, do the following:
|
||
![]() ![]() ![]() |