How to create multiple datasources in application.cfc
I am using ColdFusion 11 and having an issue creating data sources to more then one database.
The application works when I have one data source in the application.cfc, but when I add a second data source the second one does not work and I receive an error "Datasource main_db2 could not be found".
Can anyone provide me with sample code on how to set up two or more data sources using application.cfc ?
Current code that works for one data source in application.cfc.
// Application.cfc
component {
this.name = "DSNTest";
this.datasources = {
main_db1 = {
database = "CUS124",
host = "C008945DE.us.int444.com\WWGRRD06",
driver = "MSSQLServer",
username = "abc123x",
password = "password123" }
};
this.datasource = "main_db1";
}
