I need a ResultSet for quick database export with openCSV. What I have is a List that is retrieved from a named hibernate query.
How can I convert this list to resultset, in order to save it?
ty
ResultSet is an interface. So, the only thing you have to do is create your own implementation, using your list values.
public class MyResultSet implements ResultSet {
public ResultSet(List<MyClass> list) {
// ...
}
// Interface implementation. For example, the "next()" method can be implemented
// using your list iterator.
}
Then, you create an instance of MyResulSet with your list, and give it to the OpenCSV API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With