title: Spring Boot Jpa and Jdbc configuration not working as expected
body: <p>I'm working on a Spring-boot application which needs to create a brand new database and get some information from another, so I think I need configurate <strong>two</strong> <em>datasources</em>.</p>
  
  <p>After a few intents to create what I wanna do and having no success here are some questions and code I have created so far, please guide me if I'm wrong on the configuration.</p>
  
  <p>First question, despite that the new database is gonna use <strong>jpa</strong>, and the existing a <strong>jdbctemplate</strong>, the config file is still the same for both right?
  Here is my config class file:</p>
  
  <p><strong>DbConfig.java</strong></p>
  
  <pre><code>@Configuration
  public class DbConfig {
  
  @Bean(name="bitacoraDb")
  @Primary
  @ConfigurationProperties("bitacora.datasource")
  public DataSourceProperties bitacoraDataSourceProperties() {
      return new DataSourceProperties();
  }
  
  @Bean
  @Primary
  @ConfigurationProperties("bitacora.datasource")
  public DataSource bitacoraDataSource() {
      return bitacoraDataSourceProperties().initializeDataSourceBuilder().build();
  }
  
  @Bean(name="siaDb")
  @ConfigurationProperties("sia.datasource")
  public DataSource siaDataSource() {
  
      return DataSourceBuilder.create().build();
  }
  
  @Bean(name="siaJdbcTemplate")
  public JdbcTemplate jdbcTemplate(@Qualifier("siaDb") DataSource dataSource) {
  
      JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
  
      jdbcTemplate.setResultsMapCaseInsensitive(true);
  
      return jdbcTemplate;
  }
  }
  </code></pre>
  
  <p>Then, my <strong>application.properties</strong>, here I don't know if hibernate properties are working correctly:</p>
  
  <pre><code>bitacora.datasource.url=jdbc:postgresql://192.168.1.202:5432/bitacorapp
  bitacora.datasource.driverClassName=org.postgresql.Driver
  bitacora.datasource.username=argos_admin
  bitacora.datasource.password=argos@27467
  bitacora.jpa.hibernate.show_sql=true
  bitacora.jpa.hibernate.format_sql=true
  bitacora.jpa.hibernate.hbm2ddl.import_files_sql_extractor=org.hibernate.tool.hbm2ddl.MultipleLinesSqlCommandExtractor
  bitacora.jpa.hibernate.dialect=org.hibernate.dialect.PostgreSQL92Dialect
  bitacora.jpa.hibernate.ddl-auto=create-drop
  
  # --------------------
  # Second datasource
  # --------------------
  sia.datasource.url=jdbc:postgresql://192.168.1.202:5432/argosrr-serv
  sia.datasource.driverClassName=org.postgresql.Driver
  sia.datasource.username=argos_admin
  sia.datasource.password=argos@27467
  </code></pre>
  
  <p>The thing is that the new database is created in the second datasource which I don't want to, but my controllers and repositories works as expected, but I need to separate the databases.
  I don't know if after solve this problem it could lead to some others because the bad configuration.</p>
  
  <p>Thanks for your help.</p>