• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

DataSource

Engaged ,
Apr 15, 2013 Apr 15, 2013

Copy link to clipboard

Copied

I can use Application.Datasource to assign a datasource for the application.

I would like to know the web site can only has one datasource.

If my web site has more than one database on the different database server then am I able to assign the second datasource for the application or I need to assign every time if I have more than one datasource for the application,

Your help and information is great appreciated,

Regards,

Iccsi

Views

356

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Apr 15, 2013 Apr 15, 2013

You can have multiple datasources in your application.  Create each one in your CF Admin > Datasources.  Then in onApplicationStart in your application.cfc, just create each one, e.g.

<cfset application.customerDSN = "Customer_Datasource">

<cfset application.supplierDSN = "Supplier_Datasource">

Which you can then refer to in your queries or stored procedures:

<cfstoredproc datasource="#application.supplierDSN#">

Votes

Translate

Translate
Engaged ,
Apr 15, 2013 Apr 15, 2013

Copy link to clipboard

Copied

You can have multiple datasources in your application.  Create each one in your CF Admin > Datasources.  Then in onApplicationStart in your application.cfc, just create each one, e.g.

<cfset application.customerDSN = "Customer_Datasource">

<cfset application.supplierDSN = "Supplier_Datasource">

Which you can then refer to in your queries or stored procedures:

<cfstoredproc datasource="#application.supplierDSN#">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 15, 2013 Apr 15, 2013

Copy link to clipboard

Copied

LATEST

Thanks a million for helping,

Regards,

Iccsi

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation