Return to v1.4.5 docs

dataSource()



Use this method to override the data source connection information for this model.

Name Type Required Default Description
datasource string Yes The data source name to connect to.
username string No The username for the data source.
password string No The password for the data source.
dataSource(datasource [, username, password ]) <!--- In models/User.cfc --->
<cffunction name="init">
    <!--- Tell Wheels to use the data source named `users_source` instead of the default one whenever this model makes SQL calls  --->
              <cfset dataSource("users_source")>
</cffunction>