2 Replies Latest reply on Apr 15, 2013 9:56 AM by iccsi


    iccsi Level 1

      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,





        • 1. Re: DataSource
          duncancumming Level 3

          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#">

          • 2. Re: DataSource
            iccsi Level 1

            Thanks a million for helping,