Application-wide datasource in Railo
Another one of those features that I knew was is in CF 9 but didn't know was in Railo and thats Application wide datasource name.
What this means is that in your Application.cfc (NOT .cfm!) you can set a per-application datasoure which lets you ommit the "datasource" attribute in your <cfquery> tags.
Your Application.cfc
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<cfcomponent displayname="Application.cfc">
<cfscript>
// Set the application name
this.name = "myApp" & hash(getCurrentTemplatePath())
// Set the datasource
this.datasource = "myDSN";
</cfscript>
</cfcomponent>
1<cfcomponent displayname="Application.cfc">
2<cfscript>
3 // Set the application name
4 this.name = "myApp" & hash(getCurrentTemplatePath())
5
6 // Set the datasource
7 this.datasource = "myDSN";
8
9</cfscript>
10</cfcomponent>
Your test.cfm page
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<cfquery name="qry">
SELECT * FROM yourTable
</cfquery>
<cfdump var="#qry#" label="Query Dump">
1<cfquery name="qry">
2 SELECT * FROM yourTable
3 </cfquery>
4 <cfdump var="#qry#" label="Query Dump">