English | 简体中文

api-docs / org.ktorm.database / CachedRowSet / <init>

<init>

CachedRowSet(rs: ResultSet)

Special implementation of ResultSet, used to hold the query results for Ktorm.

Different from normal result sets, this class is available offline. It’s connection independent, it remains
available after the connection closed, and it’s not necessary to be closed after being used. To create an
instance of it, we can use the constructor. This constructor creates a CachedRowSet instance with all data
being retrieved from the result set into memory, so we just need to wait for GC to collect them after they
are not useful.

statement.executeQuery().use { rs ->
CachedRowSet(rs)
}

Since
2.7