How to programmatically create a Java ResultSet from custom data with no database

后端 未结 7 1907
渐次进展
渐次进展 2020-12-17 08:53

I have some existing code that accepts a java.sql.ResultSet that contains info retrieved from an Oracle database. I would now like to reuse this code, but I\'d

7条回答
  •  萌比男神i
    2020-12-17 09:05

    • Create your own AbstractResultSet class, one that (like AbstractQueue) implements all methods by throwing UnsupportedOperationException (Eclipse autogenerates these methods in a split second).
    • Now extend AbstractResultSet. The subclass can override only the methods you're interested in implementing.

提交回复
热议问题