Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8703493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:52:57+00:00 2026-06-13T02:52:57+00:00

On my local machine I’m developing using a certain db (sql server), however, when

  • 0

On my local machine I’m developing using a certain db (sql server), however, when I deploy to the development environment we are running mysql. So everytime before deploying I have to change certain properties in the config file. Properties pertaining to the datasource:

<bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url" value="jdbc:mysql://127.0.0.1:3306/mydb" />
    <property name="username" value="myuname" />
    <property name="password" value="mypwd"/>   
</bean>

Is there a way in spring mvc to have different config files for different environments? If so, how would I go about triggering the correct xml for the right environment.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:52:58+00:00Added an answer on June 13, 2026 at 2:52 am
    spring mvc to have different config files for different environments?
    

    we store database connection settings in a properties file in tomcat, each tomcat instalaltion then has its own specific db connection. Eg, a local dev box connects to the local DB server, the UAT server connects to UAT … and so on.

    then in app context we have :

    <context:property-placeholder location="file:${catalina.home}/conf/database_UAT.properties"
                                      ignore-unresolvable="true"/>
    

    So where app gets deployed determines its DB connection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing on my local machine using the built in web server that ships
I'm using a local machine for development that needs to allow Admin Party (everyone
How do I deploy ssrs on my local machine? I am using ssrs 2005.
I'm developing on my local machine (apache2, php, mysql). When I want to upload
On my local machine I develop my Rails application using MySQL, but on deployment
On my local machine, I'm trying to deploy PHP code which was obfuscated using
On my local machine I am running an administrative c# service as LocalSystem called
I am saving some emails on my local machine using MailBee.NET Objects in htm
In web projects on my local machine, I'm using a fairly simple Sass setup.
My local machine is running Ubuntu 11.10. I use Eclipse Indigo as my IDE.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.