package com.springexample; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class RunMyProgram { public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml"); DbPropertiesHolder db_properties = (DbPropertiesHolder) context.getBean("db_conf"); System.out.println("Db Configuration Details"); for (Object propertyName:db_properties.getDb_configuration().keySet()){ String propertyValue = db_properties.getDb_configuration().getProperty((String) propertyName); System.out.println(propertyName+":"+propertyValue); } } }
package com.springexample; import java.util.Properties; public class DbPropertiesHolder { Properties db_configuration = new Properties(); public Properties getDb_configuration() { return db_configuration; } public void setDb_configuration(Properties db_configuration) { this.db_configuration = db_configuration; } }
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <bean id="db_conf" class="com.springexample.DbPropertiesHolder"> <property name="db_configuration"> <props> <prop key="db_name">SpringExamplesDB</prop> <prop key="user_name">Root</prop> <prop key="password">Security@202</prop> </props> </property> </bean> </beans>
Do you want to delete a "" lesson. Warning! This delete will remove all it's sub lessons and contents.
Do you want to delete a "" sub lesson. Warning! This delete will remove all it's contents.
Do you want to delete content.
Do you want to remove selected book from favorite books.
Do you want to delete selected author from your authors list.