Class JdbcUtils.ObjectArrayRowBuilder

  • All Implemented Interfaces:
    Function<java.lang.Object[]>, Function0<java.lang.Object[]>
    Enclosing class:

    static class JdbcUtils.ObjectArrayRowBuilder
    extends java.lang.Object
    implements Function0<java.lang.Object[]>
    Builder that calls ResultSet.getObject(int) for every column, or getXxx if the result type is a primitive xxx, and returns an array of objects for each row.
    • Field Summary

      Modifier and Type Field Description
      private int columnCount  
      private org.apache.calcite.avatica.ColumnMetaData.Rep[] reps  
      private java.sql.ResultSet resultSet  
      private int[] types  
    • Constructor Summary

      Constructor Description
      ObjectArrayRowBuilder​(java.sql.ResultSet resultSet, org.apache.calcite.avatica.ColumnMetaData.Rep[] reps, int[] types)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object[] apply()  
      static Function1<java.sql.ResultSet,​Function0<java.lang.Object[]>> factory​(java.util.List<Pair<org.apache.calcite.avatica.ColumnMetaData.Rep,​java.lang.Integer>> list)  
      private static java.sql.Date shift​(java.sql.Date v)  
      private static java.sql.Time shift​(java.sql.Time v)  
      private static java.sql.Timestamp shift​(java.sql.Timestamp v)  
      private java.lang.Object value​(int i)
      Gets a value from a given column in a JDBC result set.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • resultSet

        private final java.sql.ResultSet resultSet
      • columnCount

        private final int columnCount
      • reps

        private final org.apache.calcite.avatica.ColumnMetaData.Rep[] reps
      • types

        private final int[] types
    • Constructor Detail

      • ObjectArrayRowBuilder

        ObjectArrayRowBuilder​(java.sql.ResultSet resultSet,
                              org.apache.calcite.avatica.ColumnMetaData.Rep[] reps,
                              int[] types)
                       throws java.sql.SQLException
    • Method Detail

      • factory

        public static Function1<java.sql.ResultSet,​Function0<java.lang.Object[]>> factory​(java.util.List<Pair<org.apache.calcite.avatica.ColumnMetaData.Rep,​java.lang.Integer>> list)
      • apply

        public java.lang.Object[] apply()
        Specified by:
        apply in interface Function0<java.lang.Object[]>
      • value

        private java.lang.Object value​(int i)
                                throws java.sql.SQLException
        Gets a value from a given column in a JDBC result set.
        i - Ordinal of column (1-based, per JDBC)
      • shift

        private static java.sql.Timestamp shift​(java.sql.Timestamp v)
      • shift

        private static java.sql.Time shift​(java.sql.Time v)
      • shift

        private static java.sql.Date shift​(java.sql.Date v)