Consider the following classes' structure:
BaseDAO
with methods to crest PreparedStatement and get connection from poolAccountDAO extends BaseDAO
to work withAccount
table via JDBC. This class is singletonAccountService
witch calls methods of AccountDAO like this:AccountDAO.getInstance().login(name, password).
AccountDAO
is a Spring bean with @Transactional
annotations to methods that insert some data.
Is this OK? I think singleton DAO classes can cause performance problems. May be it is better to use some spring injections into service layer classes? (I'm new to Spring, so any advice will be appriciated)