Class SqlResultSetReader

java.lang.Object
tech.tablesaw.io.jdbc.SqlResultSetReader

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

    • 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
    • appendToColumn

      protected static void appendToColumn(Column<?> column, ResultSet resultSet, Object value) throws SQLException
      Throws:
      SQLException
    • getColumnType

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