Return type for inline methods that query databases: user-defined objects

You can use the Data interface's query() method to return an instance of any Java™ class.

The method public <T> T query (java.lang.String sql, ResultHandler<RES> handler, Object... parameters) takes a ResultHandler as one of its arguments. You can use an implementation of the ResultHandler interface to supply application logic that transforms a query result into an instance of any Java class.


Feedback