Database connections are set up using the CF Administrator tool. See Database Connections for how to connect a datasource.
To execute queries all you need is the <cfquery>
tag. The <cfquery>
tag connects to and opens the database for you, all you need to do is supply it with the name of the datasource.
<cfquery name="Movies" datasource="Entertainment">
SELECT title
FROM Movies
</cfquery>
To display the query results:
<cfoutput query="Movies">
#title#<BR>
</cfoutput>