Exactly as you have it. You can put it in a
<cfquery> as such:
Code:
<cfquery name="myQuery" datasource="#application.dsn#">
(query text)
</cfquery>
Be aware though that the
onApplicationStart method only runs on the
first request to an application. This means that if you have added that
<cfset> after running some pages in your application,
#application.dsn# 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
applicationStop() function in a .cfm page, and the next request to a page will cause
onApplicationStart() to execute, and set your variable.
-Greg