View Single Post
  #2 (permalink)  
Old 11-01-2009, 12:27 AM
serjant's Avatar
serjant serjant is offline
Senior Member
 
Join Date: Jun 2008
Location: Ukraine,Zaporozhye
Posts: 486
Rep Power: 2
serjant is on a distinguished road
Send a message via ICQ to serjant Send a message via Skype™ to serjant
Default
Man use BasicDataSource, which will read the configs from the configration.propertie file, the use this dataSource whenever you want by calling it from the context:
Code:
 <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
  		<property name="driverClassName"><value>${db.driverClassName}</value></property>
  		<property name="url"><value>${db.url}</value></property>
  		<property name="username"><value>${db.username}</value></property>
  		<property name="password"><value>${db.password}</value></property>
  </bean>

 	

  <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  		<property name="location"><value>classpath:configuration.properties</value></property>
  </bean>
Reply With Quote