I want to create a method that will execute a query and return a Set of object of specific type. The type is given as param to method as follow:
Set<Person> people = Dao.executeQuery("select * from PERSON",Person.class);
In Dao class I would like to define the method as follow:
public static Set<???> executeQuery(String sql, ????){}
Can you please help me on how to write executeQuery method?
1 Answer