Class SqlResultSetReader


  • public class SqlResultSetReader
    extends Object
    Creates a Relation from the result of a SQL query, by passing the jdbc resultset to the constructor
    • Constructor Detail

      • SqlResultSetReader

        public SqlResultSetReader()
    • Method Detail

      • mapJdbcTypeToColumnType

        public static void mapJdbcTypeToColumnType​(Integer jdbc,
                                                   ColumnType columnType)
        Change or add a mapping between the given Jdbc type and column type. When reading from a database, the db column type is automatically assigned to the associated tablesaw column type
        Parameters:
        jdbc - an int representing a legal value from java.sql.types;
        columnType - a tablesaw column type
      • read

        public static Table read​(ResultSet resultSet)
                          throws SQLException
        Returns a new table with the given tableName, constructed from the given result set
        Throws:
        SQLException - if there is a problem detected in the database
      • getColumnType

        protected static ColumnType getColumnType​(int columnType,
                                                  int scale,
                                                  int precision)