Interface JdbcClient.Row

Enclosing interface:
JdbcClient

public static interface JdbcClient.Row
Restricted view of the current result row.

The row may be read only by the thread executing the current JdbcClient.RowMapper.map(Row) callback. It must not be passed to another thread and is no longer valid after the callback returns.

  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    get(int index, Class<T> type)
    Reads a value that must not be null by the column index, starting at one.
    <T> T
    get(String label, Class<T> type)
    Reads a value that must not be null by column label.
    <T> Optional<T>
    optional(int index, Class<T> type)
    Reads a nullable value by a column index that starts at one.
    <T> Optional<T>
    optional(String label, Class<T> type)
    Reads a nullable value by column label.
  • Method Details

    • optional

      <T> Optional<T> optional(int index, Class<T> type)
      Reads a nullable value by a column index that starts at one.
      Type Parameters:
      T - scalar type
      Parameters:
      index - column index, starting at one
      type - requested scalar type
      Returns:
      optional value
      Throws:
      DataException - if the column cannot be read
      NullPointerException - if the type is null
      IllegalArgumentException - if the index or type is invalid
      IllegalStateException - if the row is no longer active or the caller is not the callback thread
    • optional

      <T> Optional<T> optional(String label, Class<T> type)
      Reads a nullable value by column label.
      Type Parameters:
      T - scalar type
      Parameters:
      label - column label
      type - requested scalar type
      Returns:
      optional value
      Throws:
      DataException - if the label is absent or ambiguous, or the column cannot be read
      NullPointerException - if the label or type is null
      IllegalArgumentException - if the label or type is invalid
      IllegalStateException - if the row is no longer active or the caller is not the callback thread
    • get

      <T> T get(int index, Class<T> type)
      Reads a value that must not be null by the column index, starting at one.
      Type Parameters:
      T - scalar type
      Parameters:
      index - column index, starting at one
      type - requested scalar type
      Returns:
      value that is not null
      Throws:
      DataException - if the column contains SQL NULL or cannot be read
      NullPointerException - if the type is null
      IllegalArgumentException - if the index or type is invalid
      IllegalStateException - if the row is no longer active or the caller is not the callback thread
    • get

      <T> T get(String label, Class<T> type)
      Reads a value that must not be null by column label.
      Type Parameters:
      T - scalar type
      Parameters:
      label - column label
      type - requested scalar type
      Returns:
      value that is not null
      Throws:
      DataException - if the label is absent or ambiguous, the column contains SQL NULL, or the column cannot be read
      NullPointerException - if the label or type is null
      IllegalArgumentException - if the label or type is invalid
      IllegalStateException - if the row is no longer active or the caller is not the callback thread