several fixes
use JdbcTemplate instead of manual connection mgmt