You don't have to put database settings in the CS XML file.
Look at the examples provided with the coldspring 0.5 release.
In Application.cfm or Aplication.cfc
<cfset application.defaultProperties = structnew()/>
<!--- properties needed for rdbms storage --->
<cfset application.defaultProperties.dsn = "myDSN"/>
<cfset application.defaultProperties.dsvendor = "MySQL"/>
<cfset application.serviceFactory = createObject('component', 'coldspring.beans.DefaultXmlBeanFactory').init(structnew(),application.defaultProperties)/>
in the Coldspring XML:
<bean id="datasourceSettings" class="datasources">
<property name="type"><value>${dstype}</value></property>
<property name="datasourceName"><value>${dsn}</value></property>
<property name="vendor"><value>${vendor}</value></property>
</bean>
</beans>
Daniel
On 12/20/05,
Baz <[EMAIL PROTECTED]> wrote:
Hey Joe,
I heard it was bad security to put UN/PW info in the coldspring XML...
Cheers,
Baz
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Joe Rinehart
Sent: December 20, 2005 1:52 PM
To: [email protected]
Subject: [coldspring-dev] Dynamic Datasource
(stops lurking)
Hey Phillip,
I'd define a bean to hold datasource information, and wire it to the
CFC that needs it. That way, if datasource information need to
expand, you've got room to grow.
The XML would probably go a lot like this:
<bean id="SomeBeanNeedingDatasource"
class="tld.domain.SomeBeanNeedingDatasource">
<constuctor-arg name="Datasource">
<ref bean="Datasource" />
</constructor>
</bean>
<bean id="Datasource" class="ModelGlue.Bean.CommonBeans.Datasource">
<property name="DSN">
<value>SomeDSN</value>
</property>
<property name="Username">
<value>SomeUsername</value>
</property>
<property name="Password">
<value>SomePassword</value>
</property>
</bean>
Cheers,
Joe
--
Get Glued!
The Model-Glue ColdFusion Framework
http://www.model-glue.com
--
Daniel Schmid
Webarchitect
Seeeldstr. 305a
CH-8008 Zürich
www.danielschmid.name
+41 44 389 67 76
