In my application I have a Databasemanager class which do basics database operations like insert, select ,delete , search of resords , which open connection do operation & closes connection. My TitleDBAgent class & GroupDBAgent class extends this Databasemanager class . & do the operation related to specific requirements like it creates the sql related to select the record in table & send this sql to getRecords method in the manager class.
My requirement is to create a generic method in manager class and execute the select query & return me Vector of DAO not Vector of Vector.
You'll need something to convert the result set to a collection of DTOs. Since the DTOs are different for every table or query, it will be hard to do that in the generic class. The caller might have to pass in a reference to a converter object, possibly itself.
How is this better than just getting the result set back from the DatabaseManager? It lets the DBM make sure the result set is closed. You could put the ResultSetToDTO method in its own class.
What do you think? Is that generic enough or no? Any other pros or cons? [ December 02, 2005: Message edited by: Stan James ]
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
It's feeding time! Give me the food you were going to give to this tiny ad: