Question about Development standards I want the full exampl
@@
Question about Development standards I want the full example for the given data Separate deployment details from application context Try to divide operation details out of application context in other xml or properties file. Write the example code using beans.Solution
Property file:
<bean id=\"propertyConfigurer\" class=\"org.springframework.beans. factory.config.PropertyPlaceholderConfigurer\">
<property name=\"location\"><value>datasource.properties</value></property>
</bean>
<bean id=\"dataSource\" class=\"org.springframework.jdbc.datasource.DriverManagerDataSource\">
<property name=\"url\"><value>${database.url}</value></property>
<property name=\"driverClassName\"><value>${database.driver}</value></property>
<property name=\"username\"><value>${database.user}</value></property>
<property name=\"password\"><value>${database.password}</value></property>
</bean>
datasource.properties should contain the following entries: -
database.url=jdbc:hsqldb:mydb
database.driver=org.hsqldb.jdbcDriver
database.user=hsql
database.password=password
Jndi:
<bean id=\"myDataSource\" class=\"org.springframework.jndi.JndiObjectFactoryBean\">
<property name=\"jndiName\" value=\"jdbc/myDataSource\" />
</bean>
