You are viewing documentation for v1.0.x. Change

dataSource()

Description

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

Function Syntax

dataSource(datasource [, username, password ])

Parameters

Parameter 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.

Examples

<!--- 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>