title: Alternative to spring profiles
body: <p>Using spring 3 I can determine which bean to use at runtime. But using Spring 2.5 what is the alternative?</p>
  
  <p>Here is the config within my context file :</p>
  
  <pre><code>&lt;jee:jndi-lookup id="myDataSource" jndi-name="jdbc/mydb"
          resource-ref="true" expected-type="javax.sql.DataSource" /&gt;
  </code></pre>
  
  <p>I can use a profile to determine whether or not to use this datasource, what is the alternative when using an earlier version of spring (earlier than Spring 3)</p>
  
  <p>Update : </p>
  
  <p>"myDataSource" will be injected when I run my app locally, on a prod environment the "jndi" lookup, will be used. To inject "myDataSource" using Spring 3 I can use "profiles" but what alternative can I use if not using Spring 3 ?</p>