Read Application.DataSource in CF9

How can I read the default application.datasource file from my code?

The application dump does not show me the data source, and trying to read application.datasourcegives an error.

+3
source share
3 answers

Try resetting application.getApplicationSettings ()

+5
source

Try restarting the application. You cannot just reset the application and see the data source. But if you have this set in application.cfc, it should work.

component output = "false" {this.name = "MyDemo"; this.datasource = "DemoDB"; }

: , .

0

Application.cfc onApplicationStart(), onSessionStart() onRequestStart() ..

If you want to set variables, in your onApplicationStart () just save in the application area.

application.myVariable = myVariable;
0
source

Source: https://habr.com/ru/post/1776361/


All Articles