posted 16 years ago
Hi All. I am wondering if there is any reason NOT to do this. I have many DAO object that start like this :
Could I declare the conn, stmt, and rs variables in my BaseDAO class as protected class variables, and then in ProcedureDAO just do this ?
Then in BaseDAO I could have a method that closes all these objects, I could call it in the finally block of the getProcedure method and any other method of classes that extend BaseDAO.
I never see this in any example code, so I am wondering if there is a reason NOT to do it.