/resources
folder. Define data source configuration properties like jdbc driverClassName, url, username and password.@Configuration
annotation imports the Spring configuration. @Configuration objects are managed as Spring beans within the container, imported configurations are used to injected using @Autowired or @Inject.@ComponentScan
is equivalent to <context:component-scan base-package='...'
used to lookup the beans and components classes in the spring context.@PropertySource
Annotation use to provide a convenient and declarative mechanism for adding a PropertySource to Spring's Environment.@Bean
annotation. When JavaConfig encounters such a method, it will execute that method and register the return value as a bean within a BeanFactory. Here we have registered JdbcTemplate and DataSource beans.@Repository
annotation, It allows the component scanning to find and configure the respected DAO. @Autowired JdbcTemplate to access to a persistence resource.