How do can I change the DSN dynamically in ColdSpring through ColdBox?
--
You received this message because you are subscribed to the Google Groups "ColdBox: A ColdFusion Framework" group.
To post to this group, send email to col...@googlegroups.com
To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/coldbox
For more information, visit http://www.luismajano.com/projects/coldbox
For Documentation, visit http://ortus.svnrepository.com/coldbox/trac.cgi
<!--- coldbox.xml --->
<Datasources>
<Datasource alias="globalDSN" name="myDSNName" dbtype="mysql"
username="" password="" />
</Datasources>
<!--- make sure the environmentinterceptor is active --->
<!-- USE ENVIRONMENT CONTROL -->
<Interceptor class="coldbox.system.interceptors.environmentControl">
<Property name='configFile'>config/environments.xml.cfm</Property>
</Interceptor>
<!--- I define the dsn in each environment in the
environments.xml.cfm :--->
<Setting name="Datasources.globalDSN.name" value="mydsnname" />
I use transfer so I call the globalDSN set earlier. globalDSN is set
in the environments.xml:
<Property name="datasourceAlias">globalDSN</Property>
otherwise you just access the value of DSN via getSetting
("datasource").getName()
Marc