Programming ColdFusion

Overview

ColdFusion is a powerful platform for creating and deploying dynamic web applications. Developers like ColdFusion because its simple, tag-based language makes it easy to handle simple tasks, like processing form data and querying databases. ColdFusion is easy to learn, yet powerful enough to deliver highly scalable, robust applications.Programming ColdFusion covers everything you need to know to create effective web applications with ColdFusion and includes numerous examples that you can use for your own ...

See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (29) from $1.99   
  • New (4) from $21.59   
  • Used (25) from $1.99   
Close
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$21.59
Seller since 2008

Feedback rating:

(169)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
1565926986 BRAND NEW NEVER USED IN STOCK 125,000+ HAPPY CUSTOMERS SHIP EVERY DAY WITH FREE TRACKING NUMBER

Ships from: fallbrook, CA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
$50.96
Seller since 2009

Feedback rating:

(871)

Condition: New
1565926986 *BRAND NEW* Ships Same Day or Next!

Ships from: Springfield, VA

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$60.00
Seller since 2014

Feedback rating:

(164)

Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
$60.00
Seller since 2014

Feedback rating:

(164)

Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Close
Sort by
Sending request ...

Overview

ColdFusion is a powerful platform for creating and deploying dynamic web applications. Developers like ColdFusion because its simple, tag-based language makes it easy to handle simple tasks, like processing form data and querying databases. ColdFusion is easy to learn, yet powerful enough to deliver highly scalable, robust applications.Programming ColdFusion covers everything you need to know to create effective web applications with ColdFusion and includes numerous examples that you can use for your own applications. The book starts with ColdFusion basics and quickly progresses to topics like sharing application data, accessing databases, and maintaining state information. It also provides chapters on advanced database techniques, working with the Verity search engine, and interacting with other data sources, including LDAP directories, email servers, and other web servers. Finally, the book explores more advanced topics, such as creating custom tags, sharing data with WDDX, and calling external objects.

Read More Show Less

Product Details

  • ISBN-13: 9781565926981
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 8/20/2001
  • Edition description: Older Edition
  • Edition number: 1
  • Pages: 976
  • Product dimensions: 7.04 (w) x 9.24 (h) x 1.74 (d)

Meet the Author

Rob Brooks-Bilson is a freelance writer and a senior technology manager at Amkor Technology, where he has worked since 1996. Rob's involvement with ColdFusion goes all the way back to version 1.5 and includes several large-scale projects, the creation of numerous open source custom tags, and more recently, the open source Common Function Library Project, where he coordinates several libraries of freely available functions. Rob is a member of Team Macromedia and is a frequent speaker at ColdFusion user groups and conferences. Rob also has his CF certification as a Macromedia Certified Advanced ColdFusion 5.0 Developer. Rob is the author of O'Reilly's Programming ColdFusion MX, 2nd Edition (covering CF MX 6.1). He has written several articles on ColdFusion for Intranet Design Magazine, CF Advisor, and CNET's Builder.com.

Read More Show Less

Read an Excerpt

Chapter 11: Advanced Database Techniques

In this chapter:
Display Techniques
Drill-Down Queries
Query Caching
Advanced SQL
CFSQL
Calling Stored Procedures
Transaction Processing

This chapter attempts to strengthen the concepts we have already covered while adding several advanced techniques to your bag of ColdFusion tricks. These techniques include advanced ways to display query results, query-caching strategies, and advanced SQL topics. The advanced display techniques we'll cover allow you to enhance the way you display dynamically generated data beyond simple HTML table dumps. Taking advantage of ColdFusion's query-caching abilities allows you to shave precious processing time off your frequently run queries. The advanced SQL topics cover the essentials necessary for building dynamic, highly scalable applications.

Display Techniques

This section focuses on techniques you can use to enhance the display of dynamic data. Some of these techniques include displaying limited record sets, creating dynamic HTML tables with alternating row colors, working with various multicolumn output displays, and browsing records with next/previous. You will also learn several methods for controlling whitespace in dynamic pages in order to optimize page-download times.

Flushing Page Output

A complaint often heard regarding web applications is the amount of time it takes to return data to a user once a page is requested, be it by a form submission or a URL the user clicks on. Often this is due to the large amount of data a particular operation must sift through and return to the user. In situations such as this, it is often desirable to present the user with a "Please Wait" message while their request processes or to provide incremental amounts of data as results from a large query result set become available. ColdFusion lets you handle these tasks with a new tag introduced in Version 5.0 called CFFLUSH. The CFFLUSH tag provides a means to send incremental amounts of data from your ColdFusion server to a user's browser as they become available.

The first time a CFFLUSH tag is encountered on a page, it sends all the HTTP headers for the request along with any generated content up to the position in the template where the tag is encountered. Successive CFFLUSH tags return any content generated since the previous flush. Because of this, CFFLUSH is usually used within loops or output queries to send results back to the browser in incremental chunks. The following example shows the CFFLUSH tag used to incrementally return the results of a database query:


<H1>Outputting Query Results</h2>

Please be patient as this may take a few moments...

<P>

<!--- flush the output up to this point --->

<CFFLUSH>
 

<CFQUERY NAME="GetEmployees" DATASOURCE="ProgrammingCF">

SELECT *

FROM EmployeeDirectory

</CFQUERY>
 

<CFSET Stall=0>

<CFLOOP QUERY="GetEmployees">
 
 <!--- flush the rest of the output as it is generated in chunks of 100 
 
       bytes --->
 
 <CFFLUSH INTERVAL="100">
 
 <!--- use this loop to exaggerate the processing time --->
 
 <CFLOOP INDEX="i" FROM="1" TO="3500">
 
   <CFSET Stall = Stall+1>
 
 </CFLOOP>
  
 
 <CFOUTPUT>
 
 #Name#<BR>
 
 </CFOUTPUT> 

</CFLOOP>

If you run this example, you'll notice all of the content before the first CFFLUSH tag is output almost immediately. After that, the next CFFLUSH tag is used in a loop and specifies that the rest of the content generated by the page should be sent to the browser in chunks of 100 bytes. This is achieved by setting the INTERVAL attribute of CFFLUSH to 100. The code in the example contains an index loop that essentially ties up processing time for 3,500 iterations between the output of each name returned by the query. This results in an artificially inflated amount of time required to output the query results, which is perfect to demonstrate how the CFFLUSH tag incrementally sends data back to the browser in chunks as it becomes available. This is done because the EmployeeDirectory table doesn't contain enough records to effectively demonstrate the CFFLUSH tag.

Once a CFFLUSH tag has been used in a template, you can't use any other CFML tags that write to the HTTP header; doing so causes ColdFusion to throw an error because the header has already been sent to the browser. These tags include CFCONTENT, CFCOOKIE, CFFORM, CFHEADER, CFHTMLHEAD, and CFCONTENT. In addition, attempting to set a variable in the cookie scope with the CFSET tag results in an error. This is because cookies are passed from the server to the browser in the HTTP header.

Displaying Limited Record Sets

You may decide that for a given application, it's more effective not to display the contents of an entire record set. For these applications, you can use two additional optional attributes of the CFOUTPUT tag to display a subset of the full record set returned by a query:

STARTROW
Specifies what query row to begin outputting from
MAXROWS
Specifies the maximum number of rows to output

Example 11-1 uses the STARTROW and MAXROWS attributes of the CFOUTPUT tag to output a subset of a full record set.


<CFQUERY NAME="GetEmployeeInfo" DATASOURCE="ProgrammingCF">
 
        SELECT Name, Title, Department, Email, PhoneExt
 
        FROM EmployeeDirectory

</CFQUERY>
 

<!--- display the total number of records returned by the query --->

<H2>Displaying a Limited Record Set</H2>

<CFOUTPUT>

<H3>#GetEmployeeInfo.RecordCount# total records - Displaying records 6-10</H3>

</CFOUTPUT>
 

<!--- output rows 6-10 of the query result set --->

<TABLE CELLPADDING="3" CELLSPACING="0">

<TR BGCOLOR="#888888">
 
 <TH>Record Number</TH>
 
 <TH>Name</TH>
 
 <TH>Title</TH>
 
 <TH>Department</TH>
 
 <TH>E-mail</TH>
 
 <TH>Phone Extension</TH>

</TR>    

<CFOUTPUT QUERY="GetEmployeeInfo" STARTROW="6" MAXROWS="5">

<TR BGCOLOR="##C0C0C0">
 
 <TD>#CurrentRow#</TD>
 
 <TD>#Name#</TD>
 
 <TD>#Title#</TD>
 
 <TD>#Department#</TD>
 
 <TD><A HREF="Mailto:#Email#">#Email#</A></TD>
 
 <TD>#PhoneExt#</TD>

</TR>    

</CFOUTPUT>

</TABLE>

In Example 11-1, a query is performed against the EmployeeDirectory table. Setting the STARTROW attribute to 6 and the MAXROWS attribute to 5 results in records 6 to 10 of the query result set getting output to the browser.

Alternating Row Color in HTML Tables

Another popular way to display tabular data is to alternate the background color of the rows being displayed. The technique is easy to implement and offers an attractive way to display tabular data, so that it stands out. Example 11-2 generates an HTML table of alternating row color from a database query. The results can be seen in Figure 11-1.


<CFQUERY NAME="GetEmployeeInfo" DATASOURCE="ProgrammingCF">
 
        SELECT Name, Title, Department, Email, PhoneExt
 
        FROM EmployeeDirectory

</CFQUERY>
 

<TABLE CELLPADDING="3" CELLSPACING="0">

<TR BGCOLOR="#888888">
 
  <TH>Name</TH>
 
  <TH>Title</TH>
 
  <TH>Department</TH>
 
  <TH>E-mail</TH>
 
  <TH>Phone Extension</TH>

</TR>    
 

<CFOUTPUT QUERY="GetEmployeeInfo">

<TR BGCOLOR="###IIF(GetEmployeeInfo.currentrow MOD 2, DE('E6E6E6'), 

DE('C0C0C0'))#">
 
  <TD>#Name#</TD>
 
  <TD>#Title#</TD>
 
  <TD>#Department#</TD>
 
  <TD><A HREF="Mailto:#Email#">#Email#</A></TD>
 
  <TD>#PhoneExt#</TD>

</TR>    

</CFOUTPUT>

</TABLE>

We alternate the row color by using the IIF( ) and DE( ) functions along with the MOD operator to determine whether or not the row number for the current record is odd or even. Depending on the outcome of the evaluation, one color or the other is used as the background color for the current row. Because hex color codes are supposed to begin with a pound sign (#), we have to create an escape sequence before we call the IIF( ) function. This is done by doubling up on the first pound sign.

Multicolumn Output

Another popular formatting technique involves outputting a query result set in more than one column, similar to how a newspaper story is printed. There are several techniques you can use to achieve multicolumn output. Two of the more popular methods are covered in the following sections.

Sorting multicolumn output from left to right

One technique for outputting a result set in more than one column involves sorting the results from left to right, then top to bottom. You can see the technique for sorting multicolumn output from left to right in Example 11-3....

Example 11-1: Displaying a Limited Record Set Using CFOUTPUT Example 11-2: Alternating Row Color in HTML Tables
Read More Show Less

Table of Contents

Preface

Chapter 1: Introducing ColdFusion

Chapter 2: ColdFusion Basics

Chapter 3: Passing Data Between Templates

Chapter 4: Database Basics

Chapter 5: Maintaining Database Records

Chapter 6: Complex Datatypes

Chapter 7: Maintaining State

Chapter 8: Security

Chapter 9: Error and Exception Handling

Chapter 10: Dynamic Form Controls

Chapter 11: Advanced Database Techniques

Chapter 12: Manipulating Files and Directories

Chapter 13: Working With Email

Chapter 14: Interacting with Other Web Servers Using HTTP

Chapter 15: Interfacing with LDAP-Enabled Directories

Chapter 16: Working with the Verity Search Interface

Chapter 17: Regular Expressions in ColdFusion

Chapter 18: Scripting

Chapter 19: Creating Custom Tags

Chapter 20: Sharing Data with WDDX

Chapter 21: Working with the System Registry

Chapter 22: Using the ColdFusion Scheduler

Chapter 23: Calling External Objects

Chapter 24: Graphing and Charting

Tag Reference

Function Reference

Example Database Tables

ColdFusion Resources

Colophon

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)