Get all updates of Java4s
Newsletter

Spring Resourcebundle Example

Spring »on Feb 12, 2012 { 4 Comments } By Sivateja

Let us see how to use Resourcebundle in spring jdbc [ Dynamically load the values for property placeholders in spring configuration XML ]

Files Required

  • SpringJdbcSelect.java
  • OurLogic.java
  • spconfig.xml
  • jdbcBund.properties

Directory Structure

SpringJdbcSelect.java

OurLogic.java

spconfig.xml

jdbcBund.properties

jdbc.className = oracle.jdbc.driver.OracleDriver
jdbc.url = jdbc:oracle:thin:@localhost:1521:XE
jdbc.user = system
jdbc.pass = admin

Output:

 

You Might Also Like

Comments

4 Responses to “Spring Resourcebundle Example”
  1. Boopathy says:

    Your Explanation is Too Good yaar !!!

  2. Satish says:

    Excellent Explanation. Complex technology in simple words .. keep up the good job …

  3. shaheed jahagirdar says:

    superb explanation….. i didn’t find any alternate for this site till now…

  4. Sangram says:

    By configuring below code in spconfig.xml, the properties file can be readable.

    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations" value="classpath:com/foo/jdbc.properties"/>
    </bean>

Name*
Mail*
Website



By posting your answer, you agree to our comments policy.
What would you like to learn today?
Browse these popular technologies
Spring-Boot-tutorials Hibernate tutorials Spring tutorials Struts tutorials Servlets tutorials Ajax tutorials Log4j tutorials jQuery tutorials Json tutorials Core Java tutorials Web Services tutorials AngularJs tutorials
Most Recent Tutorials
Hibernate_Logo Hibernate Recent Posts Spring_Logo Spring Recent Posts Struts_Logo Struts Recent Posts
Contact | About Us | Privacy Policy | Advertise With Us

© 2010 - 2017 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.