Package tech.tablesaw.io.jdbc
Class SqlResultSetReader
java.lang.Object
tech.tablesaw.io.jdbc.SqlResultSetReader
Creates a Relation from the result of a SQL query, by passing the jdbc resultset to the
constructor
-
Method Summary
Modifier and TypeMethodDescriptionprotected static void
appendToColumn
(Column<?> column, ResultSet resultSet, Object value) protected static ColumnType
getColumnType
(int columnType, int scale, int precision) static void
mapJdbcTypeToColumnType
(Integer jdbc, ColumnType columnType) Change or add a mapping between the given Jdbc type and column type.static Table
Returns a new table with the given tableName, constructed from the given result set
-
Method Details
-
mapJdbcTypeToColumnType
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
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
-