Getting Started Building ColdFusion MX Applications
|
|
Configuring Your Development Environment
|
Configuring database connection and debugging options
Prior to ColdFusion development, use the ColdFusion MX Administrator to define the connection to the sample database file and any optional debugging options.
To access the ColdFusion Administrator, do either of the following:
- Select Start > Programs > Macromedia ColdFusion MX > ColdFusion MX Administrator.
- Open a browser and go to one of the following URLs:
- External web server users: http://localhost/CFIDE/administrator
- Stand-alone web server users: http://localhost:8500/CFIDE/administrator
Note: If you are acessing the ColdFusion Administrator from a remote client, you must replace localhost with the 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.
Configuring the connection to the sample database file
The following procedures describe how to configure a connection to the sample database file (CompassTravel) using the ColdFusion Administrator. Prior to using Part II of this book to build 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 users.
To define the connection to the sample Microsoft Access database:
- In the ColdFusion Administrator, select Data & Services > Data Sources.
- In the Add New Data Source dialog box, specify the following:
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 list box |
Select Microsoft Access [Macromedia] . |
- Click Add to configure the data source name and driver.
The Macromedia Microsoft Access Data Source dialog box appears.
- Specify the following:
Field |
Action |
Database File text box |
Specify the location of the CompassTravel.mdb file. Click Browse to locate and select the CompassTravel.mdb file. By default, ColdFusion MX installs the CompassTravel.mdb file in one of the following locations:
- For third-party web server configurations: web_root\cfdocs\getting_started\db
For standalone ColdFusion web server configurations: cfusionmx\web_root\getting_started\db |
Description text box |
Enter the following: Database file for Compass Travel tutorial |
- Click Show Advanced Settings and ensure that the settings for CLOB and BLOB are enabled (checked).
- Click Submit to complete the data source configuration.
The name CompassTravel appears in the Connected Data Sources dialog box.
- Click Verify All Connections to ensure that ColdFusion can access this file.
OK appears in the Status column for successful connections.
If the connection to the compass travel data source fails , do the following:
- Verify that the name of the data source file does not contain a space. If it does contain a space, delete the data source from the Connected Data Source dialog box. To do this, click the Delete action button associated with the CompassTravel data source name, then repeat the steps in this procedure to reconfigure this data source.
- Verify that the path specified for the Compass Travel database file is correct.
To define the sample PointBase database file:
- In the ColdFusion Administrator, select Data & Services > Data Sources.
The Add New Data Source dialog box appears.
- Specify the following:
Field |
Action |
Data Source name text box |
Specify the name CompassTravel. Note: Ensure that the name of the datasource file does not contain any spaces. If the name contains a space the data source connection fails. |
Driver drop-down selection box |
Select Other. |
- Click Add to configure the data source name and driver.
The PointBase data source dialog box appears:
- Specify the following:
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/coldfusionmx/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 |
- Click Show Advanced Settings to ensure that the settings for CLOB and BLOB are enabled (checked).
- Click Submit to complete the data source configuration.
The name CompassTravel appears in the Connected Data Sources dialog box.
- Click Verify All Connections to ensure that ColdFusion can access this file.
OK appears in the Status column for successful connections.
If the connection to the compass travel data source fails , do the following:
- Verify that the name of the data source file does not contain a space. If it does contain a space, delete the data source from the Connected Data Source dialog box. To do this, click the Delete action button associated with the CompassTravel data source name, then repeat the steps in this procedure to reconfigure this data source.
- Verify that the JDBC URL specified for the Compass Travel pontbase files is correct.
Enabling debugging options
The ColdFusion MX Administrator provides a variety of debugging settings that let you enable debugging information on a server-wide basis. If you are working on a development system, you can have these options turned on all the time. However, if you are working on a production system, you most likely will not want to have these options turned on, because the debugging information can appear on the bottom of an application page or in a dockable tree in your browser.
The following figure shows an example of how debugging information can appear when appended to the bottom of a page in a browser:
The location of the debugging information or the type of debugging data shown varies, depending on the options that you enable on the Debugging page in the ColdFusion Administrator. In the following example, the debugging output includes general information about the ColdFusion server, the execution time of the application, and variable information.
If you are using a development server to build the sample application in Part II of this book, you can enable some of these settings to help debug any unexpected problems.
Use the following steps to enable debugging options in the ColdFusion Administrator.
To enable debugging options:
- In the ColdFusion Administrator, select Debugging and Logging > Debugging.
A list of debugging options appear on the Debugging Settings page.
- Select the Enable Debugging check box.
When you select this option, the debugging service is enabled for all options already selected on the page.
- On Debugging Settings page, view the description of each option that is enabled. If you do not want to append debugging information for a specific option, clear the check box.
For the purpose of the tutorial in Part II of this book, enable the following debugging options:
Option |
Description |
Database Activity |
Identifies database activity related to SQL query events. |
Exception Information |
Identifies ColdFusion exceptions raised in the debugging output. |
Tracing Information |
Lets you trace event information reported in the debugging output. |
Form, URL and Session Variables |
Displays variable information in the debugging output. |
- Click Submit Changes when you are done.
Sending debugging information to remote clients
If you are using a remote client to perform the tutorial in Part II of this book, you must specify your IP address to receive debugging information. If you are working on a local client (the computer where ColdFusion is installed), this procedure is not necessary.
To recieve debugging information when using a remote client:
- In the ColdFusion Administrator, select Debugging and Logging > Debugging IP Addresses.
The Debugging IP Address page appears.
- In the IP Address text box, enter the IP address of your remote client.
- Click Add.
Comments