google-code-export / webical

Automatically exported from code.google.com/p/webical
GNU General Public License v3.0
1 stars 1 forks source link

Spring database configuration #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Move the database configuration and connection to Spring so we don't have a
dependency on the container for creating the database connection.

Martin provided us with som sample code:

{{{
<!--
        allow the user of properties from application.properties
         throughout this configuration file
    -->
    <bean id="placeholderConfig"

class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property
name="location"><value>classpath:application.properties</value></property>
        <property
name="systemPropertiesModeName"><value>SYSTEM_PROPERTIES_MODE_OVERRIDE</value></
property>
    </bean>

    <!-- DataSource -->
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
        <property name="driverClassName"><value>${jdbc.driver}</value></property>
        <property name="url"><value>${jdbc.url}</value></property>
        <property name="username"><value>${jdbc.username}</value></property>
        <property name="password"><value>${jdbc.password}</value></property>
    </bean>
}}}

Original issue reported on code.google.com by mattijsh...@gmail.com on 8 Jan 2008 at 7:59

GoogleCodeExporter commented 9 years ago

Original comment by mattijsh...@gmail.com on 8 Jan 2008 at 8:04

GoogleCodeExporter commented 9 years ago
Why would we want to do this? We explicitly decided to externalize the 
connection to
make the connection more pluggable. I'm marking this as invalid unless someone 
can
explain me what good this does.

Original comment by ivovando...@gmail.com on 12 Apr 2008 at 7:17