Thanks for sharing that. Let us know if you have other useful tips... WILL
On 4/24/06, Arvind Srinivasan <[EMAIL PROTECTED]> wrote: > > Will Glass-Husain <wglass <at> forio.com> writes: > > > > > Matt, > > > > Thanks for the note - appreciate the pragmatic comment. > > > > Are there any other changes or new capabilities you'd find useful in a data > > resource loader? > > > > Best, > > WILL > > > > After all the research based on Matt's and Will's work - i still had problems > getting DatasourceResourceLoader to work with spring. > > The thing that seemed to happen was - The dataSource object seemed to be 'set' > alright, but then subsequently new instance of 'DataSourceResourceLoader' gets > initialized despite have a singleton attribute set to true... > > So finally took a different approach to get it work...Documenting here, so > that anyone that may stumble across might find it helpful. > > <!-- spring configuraiton--> > <bean id="velocityEngine" singleton="true" > class="org.springframework.ui.velocity.VelocityEngineFactoryBean" > > <property name="velocityProperties"> > <props> > <prop key="resource.loader">ds</prop> > <prop > key="ds.resource.loader.class">org.apache.velocity.runtime.resource.loader.Data > SourceResourceLoader</prop> > <prop > key="ds.resource.loader.resource.table">tb_velocity_template</prop> > <prop > key="ds.resource.loader.resource.keycolumn">id_template</prop> > <prop > key="ds.resource.loader.resource.templatecolumn">template_definition</prop> > <prop > key="ds.resource.loader.resource.timestampcolumn">template_timestamp</prop> > <prop > key="ds.resource.loader.resource.datasource">java:comp/env/jdbc/sampdb</prop> > </props> > </property> > > <!--Datasource configration in Tomcat 5.5--> > /conf/Catalina/<<host>>/<<appcontext>>.xml > > <Context path="/xxx" docBase="xxx" debug="1" reloadable="true"> > <Resource name="jdbc/sampdb" auth="Container" > type="javax.sql.DataSource" > driverClassName="com.mysql.jdbc.Driver" > url="jdbc:mysql://localhost:3306/blogs" username="admin" > password="xxx" maxActive="20" maxIdle="10" maxWait="-1" /> > </Context> > > -- > Arvind > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Forio Business Simulations Will Glass-Husain [EMAIL PROTECTED] www.forio.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
