Interface SqlRow


  • public interface SqlRow
    SQL row.
    • Method Detail

      • getObject

        <T> T getObject​(int columnIndex)
        Gets the value of the column by index.

        The class of the returned value depends on the SQL type of the column. No implicit conversions are performed on the value.

        Parameters:
        columnIndex - column index, zero-based.
        Returns:
        value of the column
        Throws:
        java.lang.IndexOutOfBoundsException - if the column index is out of bounds
        java.lang.ClassCastException - if the type of the column type isn't assignable to the type T
        See Also:
        getMetadata(), SqlColumnMetadata.getType()
      • getObject

        <T> T getObject​(@Nonnull
                        java.lang.String columnName)
        Gets the value of the column by column name.

        Column name should be one of those defined in SqlRowMetadata, case-sensitive. You may also use SqlRowMetadata.findColumn(String) to test for column existence.

        The class of the returned value depends on the SQL type of the column. No implicit conversions are performed on the value.

        Parameters:
        columnName - column name
        Returns:
        value of the column
        Throws:
        java.lang.NullPointerException - if column name is null
        java.lang.IllegalArgumentException - if a column with the given name is not found
        java.lang.ClassCastException - if the type of the column type isn't assignable to the type T
        See Also:
        getMetadata(), SqlRowMetadata.findColumn(String), SqlColumnMetadata.getName(), SqlColumnMetadata.getType()