I am using the following datasource bean in Spring running in Tomcat 6. What is the preferred way to specify the database so that it is easy to configure a different db for your dev and prod environments?
The way I have it here would require that each time I build a WAR file for production I would have to remember to first edit the xml file and change the database.
Thanks for your helpCode:<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://localhost:3306/mydb?autoReconnect=true" /> <property name="username" value="me" /> <property name="password" value="pass" /> <property name="initialSize" value="10" /> <property name="maxActive" value="100" /> <property name="maxIdle" value="-1" /> <property name="maxWait" value="-1" /> </bean>
John


Reply With Quote