Class StringColumnVTI

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.sql.ResultSet, java.sql.Wrapper, AwareVTI

    public abstract class StringColumnVTI
    extends VTITemplate

    This is an abstract table function which assumes that all columns are strings and which coerces the strings to reasonable values for various getXXX() methods. Subclasses must implement the following ResultSet methods:

    • next( )
    • close()

    and the following protected method introduced by this class:

    • getRawColumn( int columnNumber )
    • Constructor Detail

      • StringColumnVTI

        public StringColumnVTI​(java.lang.String[] columnNames)

        Build a StringColumnVTI with the given column names

    • Method Detail

      • setColumnNames

        public void setColumnNames​(java.lang.String[] columnNames)
                            throws java.sql.SQLException

        Set the column names for this table function. This is useful for AwareVTIs, which need to figure out their column names after analyzing their execution context. Throws an exception if the column names have already been set.

        Throws:
        java.sql.SQLException
      • getColumnCount

        public int getColumnCount()

        Get the number of columns.

      • getColumnName

        public java.lang.String getColumnName​(int columnNumber)

        Get name of a column (1-based indexing).

      • wasNull

        public boolean wasNull()
                        throws java.sql.SQLException
        Specified by:
        wasNull in interface java.sql.ResultSet
        Overrides:
        wasNull in class VTITemplate
        Throws:
        java.sql.SQLException
      • findColumn

        public int findColumn​(java.lang.String columnName)
                       throws java.sql.SQLException
        Specified by:
        findColumn in interface java.sql.ResultSet
        Overrides:
        findColumn in class VTITemplate
        Throws:
        java.sql.SQLException
      • getString

        public java.lang.String getString​(int columnIndex)
                                   throws java.sql.SQLException
        Specified by:
        getString in interface java.sql.ResultSet
        Overrides:
        getString in class VTITemplate
        Throws:
        java.sql.SQLException
      • getBoolean

        public boolean getBoolean​(int columnIndex)
                           throws java.sql.SQLException
        Specified by:
        getBoolean in interface java.sql.ResultSet
        Overrides:
        getBoolean in class VTITemplate
        Throws:
        java.sql.SQLException
      • getByte

        public byte getByte​(int columnIndex)
                     throws java.sql.SQLException
        Specified by:
        getByte in interface java.sql.ResultSet
        Overrides:
        getByte in class VTITemplate
        Throws:
        java.sql.SQLException
      • getShort

        public short getShort​(int columnIndex)
                       throws java.sql.SQLException
        Specified by:
        getShort in interface java.sql.ResultSet
        Overrides:
        getShort in class VTITemplate
        Throws:
        java.sql.SQLException
      • getInt

        public int getInt​(int columnIndex)
                   throws java.sql.SQLException
        Specified by:
        getInt in interface java.sql.ResultSet
        Overrides:
        getInt in class VTITemplate
        Throws:
        java.sql.SQLException
      • getLong

        public long getLong​(int columnIndex)
                     throws java.sql.SQLException
        Specified by:
        getLong in interface java.sql.ResultSet
        Overrides:
        getLong in class VTITemplate
        Throws:
        java.sql.SQLException
      • getFloat

        public float getFloat​(int columnIndex)
                       throws java.sql.SQLException
        Specified by:
        getFloat in interface java.sql.ResultSet
        Overrides:
        getFloat in class VTITemplate
        Throws:
        java.sql.SQLException
      • getDouble

        public double getDouble​(int columnIndex)
                         throws java.sql.SQLException
        Specified by:
        getDouble in interface java.sql.ResultSet
        Overrides:
        getDouble in class VTITemplate
        Throws:
        java.sql.SQLException
      • getBigDecimal

        public java.math.BigDecimal getBigDecimal​(int columnIndex)
                                           throws java.sql.SQLException
        Specified by:
        getBigDecimal in interface java.sql.ResultSet
        Overrides:
        getBigDecimal in class VTITemplate
        Throws:
        java.sql.SQLException
      • getBytes

        public byte[] getBytes​(int columnIndex)
                        throws java.sql.SQLException
        Specified by:
        getBytes in interface java.sql.ResultSet
        Overrides:
        getBytes in class VTITemplate
        Throws:
        java.sql.SQLException
      • getDate

        public java.sql.Date getDate​(int columnIndex)
                              throws java.sql.SQLException
        Specified by:
        getDate in interface java.sql.ResultSet
        Overrides:
        getDate in class VTITemplate
        Throws:
        java.sql.SQLException
      • getTime

        public java.sql.Time getTime​(int columnIndex)
                              throws java.sql.SQLException
        Specified by:
        getTime in interface java.sql.ResultSet
        Overrides:
        getTime in class VTITemplate
        Throws:
        java.sql.SQLException
      • getTimestamp

        public java.sql.Timestamp getTimestamp​(int columnIndex)
                                        throws java.sql.SQLException
        Specified by:
        getTimestamp in interface java.sql.ResultSet
        Overrides:
        getTimestamp in class VTITemplate
        Throws:
        java.sql.SQLException
      • getAsciiStream

        public java.io.InputStream getAsciiStream​(int columnIndex)
                                           throws java.sql.SQLException
        Specified by:
        getAsciiStream in interface java.sql.ResultSet
        Overrides:
        getAsciiStream in class VTITemplate
        Throws:
        java.sql.SQLException
      • getBinaryStream

        public java.io.InputStream getBinaryStream​(int columnIndex)
                                            throws java.sql.SQLException
        Specified by:
        getBinaryStream in interface java.sql.ResultSet
        Overrides:
        getBinaryStream in class VTITemplate
        Throws:
        java.sql.SQLException
      • getBlob

        public java.sql.Blob getBlob​(int columnIndex)
                              throws java.sql.SQLException
        Specified by:
        getBlob in interface java.sql.ResultSet
        Overrides:
        getBlob in class VTITemplate
        Throws:
        java.sql.SQLException
      • getClob

        public java.sql.Clob getClob​(int columnIndex)
                              throws java.sql.SQLException
        Specified by:
        getClob in interface java.sql.ResultSet
        Overrides:
        getClob in class VTITemplate
        Throws:
        java.sql.SQLException