This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Because local variables have lesser scope and life span. As soon as the method finishes all objects that were declared in it and their reference wasn't passed on, are eligible for garbage collection. If those were instance variables, once initialized they will exist on heap until the instance of the class isn't eligible for gc. It's good practice to limit the scope and visibility of variables as much as we can.
Additionally, instance variables are shared by threads, so if you are instantiate the MyTableDAO as an instance variable in other class then, when more than one threads try to use the different methods[which are uses the same connection] from MyTableDAO , creates *problem*/race condition.