<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd"> <util:properties id="dbConfig" location="classpath:dbconfig.properties" /> </beans>
import java.util.Properties; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class SpringRunner { public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("bean-configuration.xml"); Properties dbConfigProperties =(Properties) context.getBean("dbConfig"); for (Object key:dbConfigProperties.keySet()){ System.out.println(key+":"+dbConfigProperties.get(key)); } } }
driver=com.jdbc.mysql.Driver db_name=bw_holder username=root password=mysql
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.