|
|
@ -44,11 +44,11 @@ import org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup;
|
|
|
|
@EnableConfigurationProperties(DataSourceProperties.class)
|
|
|
|
@EnableConfigurationProperties(DataSourceProperties.class)
|
|
|
|
public class JndiDataSourceAutoConfiguration {
|
|
|
|
public class JndiDataSourceAutoConfiguration {
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
@Bean(destroyMethod = "")
|
|
|
|
@ConditionalOnMissingBean
|
|
|
|
@ConditionalOnMissingBean
|
|
|
|
public DataSource dataSource(DataSourceProperties properties) {
|
|
|
|
public DataSource dataSource(DataSourceProperties properties) {
|
|
|
|
JndiDataSourceLookup dataSourceLookup = new JndiDataSourceLookup();
|
|
|
|
JndiDataSourceLookup dataSourceLookup = new JndiDataSourceLookup();
|
|
|
|
return dataSourceLookup.getDataSource(properties.getJndiName());
|
|
|
|
return dataSourceLookup.getDataSource(properties.getJndiName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|