QueryRowSet

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

Different from normal result sets, this class provides additional features:

  • Available offline: It’s connection independent, it remains available after the connection closed, and it’s not necessary to be closed after being used. Ktorm creates QueryRowSet objects 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.

  • Indexed access operator: It overloads the indexed access operator, so we can use square brackets [] to obtain the value by giving a specific Column instance. It’s less error-prone by the benefit of the compiler’s static checking. Also, we can still use getXxx functions in the ResultSet to obtain our results by labels or column indices.

val query = database.from(Employees).select()
for (row in query.rowSet) {
println(row[Employees.name])
}

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun absolute(row: Int): Boolean
Link copied to clipboard
open override fun afterLast()
Link copied to clipboard
open override fun beforeFirst()
Link copied to clipboard
open override fun cancelRowUpdates(): Nothing
Link copied to clipboard
open override fun clearWarnings()
Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun deleteRow(): Nothing
Link copied to clipboard
open override fun findColumn(columnLabel: String): Int
Link copied to clipboard
open override fun first(): Boolean
Link copied to clipboard
operator fun <C : Any> get(column: ColumnDeclaringExpression<C>): C?

Obtain the value of the specific ColumnDeclaringExpression instance.

operator fun <C : Any> get(column: Column<C>): C?

Obtain the value of the specific Column instance.

Link copied to clipboard
open override fun getArray(columnIndex: Int): Array?
open override fun getArray(columnLabel: String): Array?
Link copied to clipboard
open override fun getAsciiStream(columnIndex: Int): InputStream?
open override fun getAsciiStream(columnLabel: String): InputStream?
Link copied to clipboard
open override fun getBigDecimal(columnIndex: Int): BigDecimal?
open override fun getBigDecimal(columnLabel: String): BigDecimal?
open override fun getBigDecimal(columnIndex: Int, scale: Int): BigDecimal?
open override fun getBigDecimal(columnLabel: String, scale: Int): BigDecimal?
Link copied to clipboard
open override fun getBinaryStream(columnIndex: Int): InputStream?
open override fun getBinaryStream(columnLabel: String): InputStream?
Link copied to clipboard
open override fun getBlob(columnIndex: Int): Blob?
open override fun getBlob(columnLabel: String): Blob?
Link copied to clipboard
open override fun getBoolean(columnIndex: Int): Boolean
open override fun getBoolean(columnLabel: String): Boolean
Link copied to clipboard
open override fun getByte(columnIndex: Int): Byte
open override fun getByte(columnLabel: String): Byte
Link copied to clipboard
open override fun getBytes(columnIndex: Int): ByteArray?
open override fun getBytes(columnLabel: String): ByteArray?
Link copied to clipboard
open override fun getCharacterStream(columnIndex: Int): Reader?
open override fun getCharacterStream(columnLabel: String): Reader?
Link copied to clipboard
open override fun getClob(columnIndex: Int): Clob?
open override fun getClob(columnLabel: String): Clob?
Link copied to clipboard
open override fun getConcurrency(): Int
Link copied to clipboard
open override fun getCursorName(): Nothing
Link copied to clipboard
open override fun getDate(columnIndex: Int): Date?
open override fun getDate(columnLabel: String): Date?
open override fun getDate(columnIndex: Int, cal: Calendar): Date?
open override fun getDate(columnLabel: String, cal: Calendar): Date?
Link copied to clipboard
open override fun getDouble(columnIndex: Int): Double
open override fun getDouble(columnLabel: String): Double
Link copied to clipboard
open override fun getFetchDirection(): Int
Link copied to clipboard
open override fun getFetchSize(): Int
Link copied to clipboard
open override fun getFloat(columnIndex: Int): Float
open override fun getFloat(columnLabel: String): Float
Link copied to clipboard
fun <T : Any> CachedRowSet.getGeneratedKey(primaryKey: Column<T>): T?

Get generated key from the row set.

Link copied to clipboard
open override fun getHoldability(): Int
Link copied to clipboard
fun getInstant(columnIndex: Int): Instant?
fun getInstant(columnLabel: String): Instant?

Retrieve the value of the designated column in the current row of this row set object as a java.time.Instant object in the Java programming language.

Link copied to clipboard
open override fun getInt(columnIndex: Int): Int
open override fun getInt(columnLabel: String): Int
Link copied to clipboard
fun getLocalDate(columnIndex: Int): LocalDate?
fun getLocalDate(columnLabel: String): LocalDate?

Retrieve the value of the designated column in the current row of this row set object as a java.time.LocalDate object in the Java programming language.

Link copied to clipboard
fun getLocalDateTime(columnIndex: Int): LocalDateTime?

Retrieve the value of the designated column in the current row of this row set object as a java.time.LocalDateTime object in the Java programming language.

Link copied to clipboard
fun getLocalTime(columnIndex: Int): LocalTime?
fun getLocalTime(columnLabel: String): LocalTime?

Retrieve the value of the designated column in the current row of this row set object as a java.time.LocalTime object in the Java programming language.

Link copied to clipboard
open override fun getLong(columnIndex: Int): Long
open override fun getLong(columnLabel: String): Long
Link copied to clipboard
open override fun getMetaData(): ResultSetMetaData
Link copied to clipboard
open override fun getNCharacterStream(columnIndex: Int): Reader?
open override fun getNCharacterStream(columnLabel: String): Reader?
Link copied to clipboard
open override fun getNClob(columnIndex: Int): Nothing
open override fun getNClob(columnLabel: String?): Nothing
Link copied to clipboard
open override fun getNString(columnIndex: Int): String?
open override fun getNString(columnLabel: String): String?
Link copied to clipboard
open override fun getObject(columnIndex: Int): Any?
open override fun getObject(columnLabel: String): Any?
open override fun <T : Any> getObject(columnIndex: Int, type: Class<T>): T?
open override fun getObject(columnIndex: Int, map: Map<String, Class<*>>): Any?
open override fun <T : Any> getObject(columnLabel: String, type: Class<T>): T?
open override fun getObject(columnLabel: String, map: Map<String, Class<*>>): Any?
Link copied to clipboard
open override fun getRef(columnIndex: Int): Ref?
open override fun getRef(columnLabel: String): Ref?
Link copied to clipboard
open override fun getRow(): Int
Link copied to clipboard
open override fun getRowId(columnIndex: Int): Nothing
open override fun getRowId(columnLabel: String?): Nothing
Link copied to clipboard
open override fun getShort(columnIndex: Int): Short
open override fun getShort(columnLabel: String): Short
Link copied to clipboard
open override fun getSQLXML(columnIndex: Int): Nothing
open override fun getSQLXML(columnLabel: String?): Nothing
Link copied to clipboard
open override fun getStatement(): Statement?
Link copied to clipboard
open override fun getString(columnIndex: Int): String?
open override fun getString(columnLabel: String): String?
Link copied to clipboard
open override fun getTime(columnIndex: Int): Time?
open override fun getTime(columnLabel: String): Time?
open override fun getTime(columnIndex: Int, cal: Calendar): Time?
open override fun getTime(columnLabel: String, cal: Calendar): Time?
Link copied to clipboard
open override fun getTimestamp(columnIndex: Int): Timestamp?
open override fun getTimestamp(columnLabel: String): Timestamp?
open override fun getTimestamp(columnIndex: Int, cal: Calendar): Timestamp?
open override fun getTimestamp(columnLabel: String, cal: Calendar): Timestamp?
Link copied to clipboard
open override fun getType(): Int
Link copied to clipboard
open override fun getUnicodeStream(columnIndex: Int): InputStream?
open override fun getUnicodeStream(columnLabel: String): InputStream?
Link copied to clipboard
open override fun getURL(columnIndex: Int): URL?
open override fun getURL(columnLabel: String): URL?
Link copied to clipboard
open override fun getWarnings(): SQLWarning?
Link copied to clipboard
fun hasColumn(column: Column<*>): Boolean

Check if the specific Column exists in this result set.

Link copied to clipboard
open override fun insertRow(): Nothing
Link copied to clipboard
open override fun isAfterLast(): Boolean
Link copied to clipboard
open override fun isBeforeFirst(): Boolean
Link copied to clipboard
open override fun isClosed(): Boolean
Link copied to clipboard
open override fun isFirst(): Boolean
Link copied to clipboard
open override fun isLast(): Boolean
Link copied to clipboard
open override fun isWrapperFor(iface: Class<*>): Boolean
Link copied to clipboard
open override fun last(): Boolean
Link copied to clipboard
open override fun moveToCurrentRow(): Nothing
Link copied to clipboard
open override fun moveToInsertRow(): Nothing
Link copied to clipboard
open operator override fun next(): Boolean
Link copied to clipboard
open override fun previous(): Boolean
Link copied to clipboard
open override fun refreshRow(): Nothing
Link copied to clipboard
open override fun relative(rows: Int): Boolean
Link copied to clipboard
open override fun rowDeleted(): Nothing
Link copied to clipboard
open override fun rowInserted(): Nothing
Link copied to clipboard
open override fun rowUpdated(): Nothing
Link copied to clipboard
open override fun setFetchDirection(direction: Int)
Link copied to clipboard
open override fun setFetchSize(rows: Int)
Link copied to clipboard
fun size(): Int

Return the number of rows in this row set.

Link copied to clipboard
open override fun <T : Any> unwrap(iface: Class<T>): T
Link copied to clipboard
open override fun updateArray(columnIndex: Int, x: Array?): Nothing
open override fun updateArray(columnLabel: String?, x: Array?): Nothing
Link copied to clipboard
open override fun updateAsciiStream(columnIndex: Int, x: InputStream?): Nothing
open override fun updateAsciiStream(columnLabel: String?, x: InputStream?): Nothing
open override fun updateAsciiStream(columnIndex: Int, x: InputStream?, length: Int): Nothing
open override fun updateAsciiStream(columnIndex: Int, x: InputStream?, length: Long): Nothing
open override fun updateAsciiStream(columnLabel: String?, x: InputStream?, length: Int): Nothing
open override fun updateAsciiStream(columnLabel: String?, x: InputStream?, length: Long): Nothing
Link copied to clipboard
open override fun updateBigDecimal(columnIndex: Int, x: BigDecimal?): Nothing
open override fun updateBigDecimal(columnLabel: String?, x: BigDecimal?): Nothing
Link copied to clipboard
open override fun updateBinaryStream(columnIndex: Int, x: InputStream?): Nothing
open override fun updateBinaryStream(columnLabel: String?, x: InputStream?): Nothing
open override fun updateBinaryStream(columnIndex: Int, x: InputStream?, length: Int): Nothing
open override fun updateBinaryStream(columnIndex: Int, x: InputStream?, length: Long): Nothing
open override fun updateBinaryStream(columnLabel: String?, x: InputStream?, length: Int): Nothing
open override fun updateBinaryStream(columnLabel: String?, x: InputStream?, length: Long): Nothing
Link copied to clipboard
open override fun updateBlob(columnIndex: Int, inputStream: InputStream?): Nothing
open override fun updateBlob(columnIndex: Int, x: Blob?): Nothing
open override fun updateBlob(columnLabel: String?, inputStream: InputStream?): Nothing
open override fun updateBlob(columnLabel: String?, x: Blob?): Nothing
open override fun updateBlob(columnIndex: Int, inputStream: InputStream?, length: Long): Nothing
open override fun updateBlob(columnLabel: String?, inputStream: InputStream?, length: Long): Nothing
Link copied to clipboard
open override fun updateBoolean(columnIndex: Int, x: Boolean): Nothing
open override fun updateBoolean(columnLabel: String?, x: Boolean): Nothing
Link copied to clipboard
open override fun updateByte(columnIndex: Int, x: Byte): Nothing
open override fun updateByte(columnLabel: String?, x: Byte): Nothing
Link copied to clipboard
open override fun updateBytes(columnIndex: Int, x: ByteArray?): Nothing
open override fun updateBytes(columnLabel: String?, x: ByteArray?): Nothing
Link copied to clipboard
open override fun updateCharacterStream(columnIndex: Int, x: Reader?): Nothing
open override fun updateCharacterStream(columnLabel: String?, reader: Reader?): Nothing
open override fun updateCharacterStream(columnIndex: Int, x: Reader?, length: Int): Nothing
open override fun updateCharacterStream(columnIndex: Int, x: Reader?, length: Long): Nothing
open override fun updateCharacterStream(columnLabel: String?, reader: Reader?, length: Int): Nothing
open override fun updateCharacterStream(columnLabel: String?, reader: Reader?, length: Long): Nothing
Link copied to clipboard
open override fun updateClob(columnIndex: Int, reader: Reader?): Nothing
open override fun updateClob(columnIndex: Int, x: Clob?): Nothing
open override fun updateClob(columnLabel: String?, reader: Reader?): Nothing
open override fun updateClob(columnLabel: String?, x: Clob?): Nothing
open override fun updateClob(columnIndex: Int, reader: Reader?, length: Long): Nothing
open override fun updateClob(columnLabel: String?, reader: Reader?, length: Long): Nothing
Link copied to clipboard
open override fun updateDate(columnIndex: Int, x: Date?): Nothing
open override fun updateDate(columnLabel: String?, x: Date?): Nothing
Link copied to clipboard
open override fun updateDouble(columnIndex: Int, x: Double): Nothing
open override fun updateDouble(columnLabel: String?, x: Double): Nothing
Link copied to clipboard
open override fun updateFloat(columnIndex: Int, x: Float): Nothing
open override fun updateFloat(columnLabel: String?, x: Float): Nothing
Link copied to clipboard
open override fun updateInt(columnIndex: Int, x: Int): Nothing
open override fun updateInt(columnLabel: String?, x: Int): Nothing
Link copied to clipboard
open override fun updateLong(columnIndex: Int, x: Long): Nothing
open override fun updateLong(columnLabel: String?, x: Long): Nothing
Link copied to clipboard
open override fun updateNCharacterStream(columnIndex: Int, x: Reader?): Nothing
open override fun updateNCharacterStream(columnLabel: String?, reader: Reader?): Nothing
open override fun updateNCharacterStream(columnIndex: Int, x: Reader?, length: Long): Nothing
open override fun updateNCharacterStream(columnLabel: String?, reader: Reader?, length: Long): Nothing
Link copied to clipboard
open override fun updateNClob(columnIndex: Int, reader: Reader?): Nothing
open override fun updateNClob(columnIndex: Int, nClob: NClob?): Nothing
open override fun updateNClob(columnLabel: String?, reader: Reader?): Nothing
open override fun updateNClob(columnLabel: String?, nClob: NClob?): Nothing
open override fun updateNClob(columnIndex: Int, reader: Reader?, length: Long): Nothing
open override fun updateNClob(columnLabel: String?, reader: Reader?, length: Long): Nothing
Link copied to clipboard
open override fun updateNString(columnIndex: Int, nString: String?): Nothing
open override fun updateNString(columnLabel: String?, nString: String?): Nothing
Link copied to clipboard
open override fun updateNull(columnIndex: Int): Nothing
open override fun updateNull(columnLabel: String?): Nothing
Link copied to clipboard
open override fun updateObject(columnIndex: Int, x: Any?): Nothing
open override fun updateObject(columnLabel: String?, x: Any?): Nothing
open override fun updateObject(columnIndex: Int, x: Any?, targetSqlType: SQLType?): Nothing
open override fun updateObject(columnIndex: Int, x: Any?, scaleOrLength: Int): Nothing
open override fun updateObject(columnLabel: String?, x: Any?, targetSqlType: SQLType?): Nothing
open override fun updateObject(columnLabel: String?, x: Any?, scaleOrLength: Int): Nothing
open override fun updateObject(columnIndex: Int, x: Any?, targetSqlType: SQLType?, scaleOrLength: Int): Nothing
open override fun updateObject(columnLabel: String?, x: Any?, targetSqlType: SQLType?, scaleOrLength: Int): Nothing
Link copied to clipboard
open override fun updateRef(columnIndex: Int, x: Ref?): Nothing
open override fun updateRef(columnLabel: String?, x: Ref?): Nothing
Link copied to clipboard
open override fun updateRow(): Nothing
Link copied to clipboard
open override fun updateRowId(columnIndex: Int, x: RowId?): Nothing
open override fun updateRowId(columnLabel: String?, x: RowId?): Nothing
Link copied to clipboard
open override fun updateShort(columnIndex: Int, x: Short): Nothing
open override fun updateShort(columnLabel: String?, x: Short): Nothing
Link copied to clipboard
open override fun updateSQLXML(columnIndex: Int, xmlObject: SQLXML?): Nothing
open override fun updateSQLXML(columnLabel: String?, xmlObject: SQLXML?): Nothing
Link copied to clipboard
open override fun updateString(columnIndex: Int, x: String?): Nothing
open override fun updateString(columnLabel: String?, x: String?): Nothing
Link copied to clipboard
open override fun updateTime(columnIndex: Int, x: Time?): Nothing
open override fun updateTime(columnLabel: String?, x: Time?): Nothing
Link copied to clipboard
open override fun updateTimestamp(columnIndex: Int, x: Timestamp?): Nothing
open override fun updateTimestamp(columnLabel: String?, x: Timestamp?): Nothing
Link copied to clipboard
open override fun wasNull(): Boolean