2009 Look, No Datasource
Look at this code snippet. Notice anything odd about it?
ORDER BY ArtName
Yep, the <CFQUERY> tag in the above snippet is missing the DATASOURCE attribute. And yet, this code works. Why? Take a look at this Application.cfc file:
In ColdFusion Centaur you can now specify an application wide default datasource by setting this.datasource in Application.cfc. The specified datasource becomes the default for all <CFQUERY>, <CFSTOREDPROC>, and other tags that expect a datasource to be specified. Of course, datasource can still be specified manually if needed, and a specified datasource will override the application default one.
This is one of those duh! enhancements that just makes sense. And, as I'll explain in an upcoming post, it also has another important purpose.