these days I write some code without spring support, and try write code like this In Service..
c = ds.getConnection();
c.setAutoCommit(false);
try {
dao.findXX(c, id);
c.commit();
} catch (Exception ex) {
c.rollback();
}
but, I meet some problem when I try to mock DAO, and test my service. because getConnection is called, it will connect to a db which doesn't want to see for our.
how to write service/dao with jdbc to easy test?