Package com.clickhouse.jdbc
Class ClickHouseResultSet
- java.lang.Object
-
- com.clickhouse.jdbc.JdbcWrapper
-
- com.clickhouse.jdbc.AbstractResultSet
-
- com.clickhouse.jdbc.ClickHouseResultSet
-
- All Implemented Interfaces:
AutoCloseable,ResultSet,Wrapper
- Direct Known Subclasses:
ClickHouseScrollableResultSet
public class ClickHouseResultSet extends AbstractResultSet
-
-
Field Summary
Fields Modifier and Type Field Description protected List<ClickHouseColumn>columnsprotected ClickHouseConfigconfigprotected Stringdatabaseprotected CalendardefaultCalendarprotected Map<String,Class<?>>defaultTypeMapprotected intmaxRowsprotected ClickHouseResultSetMetaDatametaDataprotected ClickHouseResponseresponseprotected ClickHouseStatementstatementprotected Stringtableprotected booleanwrapObject-
Fields inherited from interface java.sql.ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
-
-
Constructor Summary
Constructors Constructor Description ClickHouseResultSet(String database, String table, ClickHouseStatement statement, ClickHouseResponse response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected voidensureRead(int columnIndex)intfindColumn(String columnLabel)ArraygetArray(int columnIndex)ArraygetArray(String columnLabel)InputStreamgetAsciiStream(int columnIndex)InputStreamgetAsciiStream(String columnLabel)BigDecimalgetBigDecimal(int columnIndex)BigDecimalgetBigDecimal(int columnIndex, int scale)BigDecimalgetBigDecimal(String columnLabel)BigDecimalgetBigDecimal(String columnLabel, int scale)BigIntegergetBigInteger(int columnIndex)BigIntegergetBigInteger(String columnLabel)InputStreamgetBinaryStream(int columnIndex)InputStreamgetBinaryStream(String columnLabel)BlobgetBlob(int columnIndex)BlobgetBlob(String columnLabel)booleangetBoolean(int columnIndex)booleangetBoolean(String columnLabel)bytegetByte(int columnIndex)bytegetByte(String columnLabel)byte[]getBytes(int columnIndex)byte[]getBytes(String columnLabel)ReadergetCharacterStream(int columnIndex)ReadergetCharacterStream(String columnLabel)ClobgetClob(int columnIndex)ClobgetClob(String columnLabel)String[]getColumnNames()protected List<ClickHouseColumn>getColumns()StringgetCursorName()DategetDate(int columnIndex)DategetDate(int columnIndex, Calendar cal)DategetDate(String columnLabel)DategetDate(String columnLabel, Calendar cal)doublegetDouble(int columnIndex)doublegetDouble(String columnLabel)intgetFetchSize()floatgetFloat(int columnIndex)floatgetFloat(String columnLabel)intgetInt(int columnIndex)intgetInt(String columnLabel)longgetLong(int columnIndex)longgetLong(String columnLabel)ResultSetMetaDatagetMetaData()ReadergetNCharacterStream(int columnIndex)ReadergetNCharacterStream(String columnLabel)NClobgetNClob(int columnIndex)NClobgetNClob(String columnLabel)StringgetNString(int columnIndex)StringgetNString(String columnLabel)ObjectgetObject(int columnIndex)<T> TgetObject(int columnIndex, Class<T> type)ObjectgetObject(int columnIndex, Map<String,Class<?>> map)ObjectgetObject(String columnLabel)<T> TgetObject(String columnLabel, Class<T> type)ObjectgetObject(String columnLabel, Map<String,Class<?>> map)RefgetRef(int columnIndex)RefgetRef(String columnLabel)intgetRow()RowIdgetRowId(int columnIndex)RowIdgetRowId(String columnLabel)shortgetShort(int columnIndex)shortgetShort(String columnLabel)SQLXMLgetSQLXML(int columnIndex)SQLXMLgetSQLXML(String columnLabel)StatementgetStatement()StringgetString(int columnIndex)StringgetString(String columnLabel)TimegetTime(int columnIndex)TimegetTime(int columnIndex, Calendar cal)TimegetTime(String columnLabel)TimegetTime(String columnLabel, Calendar cal)TimestampgetTimestamp(int columnIndex)TimestampgetTimestamp(int columnIndex, Calendar cal)TimestampgetTimestamp(String columnLabel)TimestampgetTimestamp(String columnLabel, Calendar cal)InputStreamgetUnicodeStream(int columnIndex)InputStreamgetUnicodeStream(String columnLabel)URLgetURL(int columnIndex)URLgetURL(String columnLabel)protected ClickHouseValuegetValue(int columnIndex)protected booleanhasNext()Check if there is another row.booleanisAfterLast()booleanisBeforeFirst()booleanisClosed()booleanisFirst()booleanisLast()booleanisWrapperFor(Class<?> iface)booleannext()voidsetFetchSize(int rows)<T> Tunwrap(Class<T> iface)booleanwasNull()-
Methods inherited from class com.clickhouse.jdbc.AbstractResultSet
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, deleteRow, ensureOpen, first, getConcurrency, getFetchDirection, getHoldability, getType, getWarnings, insertRow, last, moveToCurrentRow, moveToInsertRow, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp
-
-
-
-
Field Detail
-
database
protected final String database
-
table
protected final String table
-
statement
protected final ClickHouseStatement statement
-
response
protected final ClickHouseResponse response
-
config
protected final ClickHouseConfig config
-
wrapObject
protected final boolean wrapObject
-
columns
protected final List<ClickHouseColumn> columns
-
defaultCalendar
protected final Calendar defaultCalendar
-
maxRows
protected final int maxRows
-
metaData
protected final ClickHouseResultSetMetaData metaData
-
-
Constructor Detail
-
ClickHouseResultSet
public ClickHouseResultSet(String database, String table, ClickHouseStatement statement, ClickHouseResponse response) throws SQLException
- Throws:
SQLException
-
-
Method Detail
-
ensureRead
protected void ensureRead(int columnIndex) throws SQLException- Throws:
SQLException
-
getColumns
protected List<ClickHouseColumn> getColumns()
-
getValue
protected ClickHouseValue getValue(int columnIndex) throws SQLException
- Throws:
SQLException
-
hasNext
protected boolean hasNext() throws SQLExceptionCheck if there is another row.- Returns:
trueif this result set has another row after the current cursor position,falseelse- Throws:
SQLException- if something goes wrong
-
getBigInteger
public BigInteger getBigInteger(int columnIndex) throws SQLException
- Throws:
SQLException
-
getBigInteger
public BigInteger getBigInteger(String columnLabel) throws SQLException
- Throws:
SQLException
-
getColumnNames
public String[] getColumnNames()
-
close
public void close() throws SQLException- Throws:
SQLException
-
findColumn
public int findColumn(String columnLabel) throws SQLException
- Throws:
SQLException
-
getArray
public Array getArray(int columnIndex) throws SQLException
- Throws:
SQLException
-
getArray
public Array getArray(String columnLabel) throws SQLException
- Throws:
SQLException
-
getAsciiStream
public InputStream getAsciiStream(int columnIndex) throws SQLException
- Throws:
SQLException
-
getAsciiStream
public InputStream getAsciiStream(String columnLabel) throws SQLException
- Throws:
SQLException
-
getBigDecimal
public BigDecimal getBigDecimal(int columnIndex) throws SQLException
- Throws:
SQLException
-
getBigDecimal
public BigDecimal getBigDecimal(String columnLabel) throws SQLException
- Throws:
SQLException
-
getBigDecimal
public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException
- Throws:
SQLException
-
getBigDecimal
public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException
- Throws:
SQLException
-
getBinaryStream
public InputStream getBinaryStream(int columnIndex) throws SQLException
- Throws:
SQLException
-
getBinaryStream
public InputStream getBinaryStream(String columnLabel) throws SQLException
- Throws:
SQLException
-
getBlob
public Blob getBlob(int columnIndex) throws SQLException
- Throws:
SQLException
-
getBlob
public Blob getBlob(String columnLabel) throws SQLException
- Throws:
SQLException
-
getBoolean
public boolean getBoolean(int columnIndex) throws SQLException- Throws:
SQLException
-
getBoolean
public boolean getBoolean(String columnLabel) throws SQLException
- Throws:
SQLException
-
getByte
public byte getByte(int columnIndex) throws SQLException- Throws:
SQLException
-
getByte
public byte getByte(String columnLabel) throws SQLException
- Throws:
SQLException
-
getBytes
public byte[] getBytes(int columnIndex) throws SQLException- Throws:
SQLException
-
getBytes
public byte[] getBytes(String columnLabel) throws SQLException
- Throws:
SQLException
-
getCharacterStream
public Reader getCharacterStream(int columnIndex) throws SQLException
- Throws:
SQLException
-
getCharacterStream
public Reader getCharacterStream(String columnLabel) throws SQLException
- Throws:
SQLException
-
getClob
public Clob getClob(int columnIndex) throws SQLException
- Throws:
SQLException
-
getClob
public Clob getClob(String columnLabel) throws SQLException
- Throws:
SQLException
-
getCursorName
public String getCursorName() throws SQLException
- Throws:
SQLException
-
getDate
public Date getDate(int columnIndex) throws SQLException
- Throws:
SQLException
-
getDate
public Date getDate(String columnLabel) throws SQLException
- Throws:
SQLException
-
getDate
public Date getDate(int columnIndex, Calendar cal) throws SQLException
- Throws:
SQLException
-
getDate
public Date getDate(String columnLabel, Calendar cal) throws SQLException
- Throws:
SQLException
-
getDouble
public double getDouble(int columnIndex) throws SQLException- Throws:
SQLException
-
getDouble
public double getDouble(String columnLabel) throws SQLException
- Throws:
SQLException
-
getFetchSize
public int getFetchSize() throws SQLException- Throws:
SQLException
-
getFloat
public float getFloat(int columnIndex) throws SQLException- Throws:
SQLException
-
getFloat
public float getFloat(String columnLabel) throws SQLException
- Throws:
SQLException
-
getInt
public int getInt(int columnIndex) throws SQLException- Throws:
SQLException
-
getInt
public int getInt(String columnLabel) throws SQLException
- Throws:
SQLException
-
getLong
public long getLong(int columnIndex) throws SQLException- Throws:
SQLException
-
getLong
public long getLong(String columnLabel) throws SQLException
- Throws:
SQLException
-
getMetaData
public ResultSetMetaData getMetaData() throws SQLException
- Throws:
SQLException
-
getNCharacterStream
public Reader getNCharacterStream(int columnIndex) throws SQLException
- Throws:
SQLException
-
getNCharacterStream
public Reader getNCharacterStream(String columnLabel) throws SQLException
- Throws:
SQLException
-
getNClob
public NClob getNClob(int columnIndex) throws SQLException
- Throws:
SQLException
-
getNClob
public NClob getNClob(String columnLabel) throws SQLException
- Throws:
SQLException
-
getNString
public String getNString(int columnIndex) throws SQLException
- Throws:
SQLException
-
getNString
public String getNString(String columnLabel) throws SQLException
- Throws:
SQLException
-
getObject
public Object getObject(int columnIndex) throws SQLException
- Throws:
SQLException
-
getObject
public Object getObject(String columnLabel) throws SQLException
- Throws:
SQLException
-
getObject
public Object getObject(int columnIndex, Map<String,Class<?>> map) throws SQLException
- Throws:
SQLException
-
getObject
public Object getObject(String columnLabel, Map<String,Class<?>> map) throws SQLException
- Throws:
SQLException
-
getObject
public <T> T getObject(int columnIndex, Class<T> type) throws SQLException- Throws:
SQLException
-
getObject
public <T> T getObject(String columnLabel, Class<T> type) throws SQLException
- Throws:
SQLException
-
getRef
public Ref getRef(int columnIndex) throws SQLException
- Throws:
SQLException
-
getRef
public Ref getRef(String columnLabel) throws SQLException
- Throws:
SQLException
-
getRow
public int getRow() throws SQLException- Throws:
SQLException
-
getRowId
public RowId getRowId(int columnIndex) throws SQLException
- Throws:
SQLException
-
getRowId
public RowId getRowId(String columnLabel) throws SQLException
- Throws:
SQLException
-
getSQLXML
public SQLXML getSQLXML(int columnIndex) throws SQLException
- Throws:
SQLException
-
getSQLXML
public SQLXML getSQLXML(String columnLabel) throws SQLException
- Throws:
SQLException
-
getShort
public short getShort(int columnIndex) throws SQLException- Throws:
SQLException
-
getShort
public short getShort(String columnLabel) throws SQLException
- Throws:
SQLException
-
getStatement
public Statement getStatement() throws SQLException
- Throws:
SQLException
-
getString
public String getString(int columnIndex) throws SQLException
- Throws:
SQLException
-
getString
public String getString(String columnLabel) throws SQLException
- Throws:
SQLException
-
getTime
public Time getTime(int columnIndex) throws SQLException
- Throws:
SQLException
-
getTime
public Time getTime(String columnLabel) throws SQLException
- Throws:
SQLException
-
getTime
public Time getTime(int columnIndex, Calendar cal) throws SQLException
- Throws:
SQLException
-
getTime
public Time getTime(String columnLabel, Calendar cal) throws SQLException
- Throws:
SQLException
-
getTimestamp
public Timestamp getTimestamp(int columnIndex) throws SQLException
- Throws:
SQLException
-
getTimestamp
public Timestamp getTimestamp(String columnLabel) throws SQLException
- Throws:
SQLException
-
getTimestamp
public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException
- Throws:
SQLException
-
getTimestamp
public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException
- Throws:
SQLException
-
getURL
public URL getURL(int columnIndex) throws SQLException
- Throws:
SQLException
-
getURL
public URL getURL(String columnLabel) throws SQLException
- Throws:
SQLException
-
getUnicodeStream
public InputStream getUnicodeStream(int columnIndex) throws SQLException
- Throws:
SQLException
-
getUnicodeStream
public InputStream getUnicodeStream(String columnLabel) throws SQLException
- Throws:
SQLException
-
isAfterLast
public boolean isAfterLast() throws SQLException- Throws:
SQLException
-
isBeforeFirst
public boolean isBeforeFirst() throws SQLException- Throws:
SQLException
-
isClosed
public boolean isClosed() throws SQLException- Throws:
SQLException
-
isFirst
public boolean isFirst() throws SQLException- Throws:
SQLException
-
isLast
public boolean isLast() throws SQLException- Throws:
SQLException
-
next
public boolean next() throws SQLException- Throws:
SQLException
-
setFetchSize
public void setFetchSize(int rows) throws SQLException- Throws:
SQLException
-
wasNull
public boolean wasNull() throws SQLException- Throws:
SQLException
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface) throws SQLException
- Specified by:
isWrapperForin interfaceWrapper- Overrides:
isWrapperForin classJdbcWrapper- Throws:
SQLException
-
unwrap
public <T> T unwrap(Class<T> iface) throws SQLException
- Specified by:
unwrapin interfaceWrapper- Overrides:
unwrapin classJdbcWrapper- Throws:
SQLException
-
-