klyn.data.sql.internal.SQLValueReader.read
method

    public static read(rows as ResultSet, index as Int, targetType as Type) as Object:

Description

Reads and converts one column without silent narrowing.

Parameters

Parameter | Description
--- | ---
`rows` | Result set positioned on the row to read.
`index` | One-based SQL column index.
`targetType` | Exact Klyn type required by the entity mapping.

Returns

The converted value, or `null` for an SQL NULL.

Throws

- ValueException if the SQL text is invalid for a supported primitive type.
- EntityMappingException if no exact converter exists for `targetType`.

Example

    value = SQLValueReader.read(rows, 1, Int.type)