How to use jndi datasource in dao?
问题 I'm trying to do my first web project using tomcat, jsp, servlets and log4j. I have TO like: User, Subject, Faculty etc, and DAO objects like: UserRepository, SubjectRepository, FacultyRepository etc. With repositories I have the following hierarchy (not all entities placed): The initialization of DataSource in AbstractRepository goes this way: public abstract class AbstractRepository<T> implements Repository<T> { private final static Logger LOG = Logger .getLogger(AbstractRepository.class);