Exactly as you have it. You can put it in a
<cfquery name="myQuery" datasource="#application.dsn#">
Be aware though that the
method only runs on the first request
to an application. This means that if you have added that
running some pages in your application,
will not be set until you do one of the following:
a) Restart the ColdFusion service on your computer.
b) Let the application time out (which you probably don't want to wait for!), or
c) If you have ColdFusion 9, you can run the
function in a .cfm page, and the next request to a page will cause
to execute, and set your variable.