ColdFusion 9 Feature: Using cfquery Without a Datasource Specified
Ben Forta gave us a sneak preview into one of the new ColdFusion 9 features. According to his website, You can now use cfquery without a datsource:
<cfquery name="getTypes">
SELECT TypeID, Type
FROM Types
</cfquery>
As long as you specify a datasource in your Application.cfc file:
<cfcomponent>
<cfset this.datasource="myDataSource">
</cfcomponent>
This is a great time-saver and especially will allow for increased code sharing between developers and applications. You will be able to drop existing or open-source queries into new applications without having to do a find/replace on the original code to replace the existing datasource.
