28 lines
526 B
Java
28 lines
526 B
Java
|
package hycom.dao;
|
||
|
|
||
|
import javax.annotation.PostConstruct;
|
||
|
import javax.annotation.Resource;
|
||
|
import javax.sql.DataSource;
|
||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||
|
import org.springframework.stereotype.Component;
|
||
|
|
||
|
/**
|
||
|
* Abstract clas for all DAO objects
|
||
|
*/
|
||
|
|
||
|
@Component
|
||
|
public abstract class BaseDao {
|
||
|
|
||
|
@Resource
|
||
|
protected DataSource dataSource;
|
||
|
|
||
|
protected JdbcTemplate jdbcTemplate;
|
||
|
|
||
|
@PostConstruct
|
||
|
private void init() {
|
||
|
jdbcTemplate = new JdbcTemplate(dataSource);
|
||
|
System.out.println(jdbcTemplate);
|
||
|
}
|
||
|
|
||
|
}
|