Package com.clickhouse.jdbc.internal
Class ClickHouseStatementImpl
java.lang.Object
com.clickhouse.jdbc.JdbcWrapper
com.clickhouse.jdbc.internal.ClickHouseStatementImpl
- All Implemented Interfaces:
com.clickhouse.config.ClickHouseConfigChangeListener<com.clickhouse.client.ClickHouseRequest<?>>,ClickHouseStatement,AutoCloseable,Statement,Wrapper
- Direct Known Subclasses:
AbstractPreparedStatement
public class ClickHouseStatementImpl
extends JdbcWrapper
implements com.clickhouse.config.ClickHouseConfigChangeListener<com.clickhouse.client.ClickHouseRequest<?>>, ClickHouseStatement
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JdbcTypeMappingprotected ClickHouseSqlStatement[]Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClickHouseStatementImpl(ClickHouseConnectionImpl connection, com.clickhouse.client.ClickHouseRequest<?> request, int resultSetType, int resultSetConcurrency, int resultSetHoldability) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcancel()voidvoidvoidclose()voidprotected voidbooleanbooleanbooleanbooleanint[]protected intexecuteInsert(String sql, InputStream input) long[]longexecuteLargeUpdate(String sql) executeQuery(String sql) protected com.clickhouse.client.ClickHouseResponseexecuteStatement(ClickHouseSqlStatement stmt, Map<com.clickhouse.config.ClickHouseOption, Serializable> options, List<com.clickhouse.data.ClickHouseExternalTable> tables, Map<String, String> settings) protected com.clickhouse.client.ClickHouseResponseexecuteStatement(String stmt, Map<com.clickhouse.config.ClickHouseOption, Serializable> options, List<com.clickhouse.data.ClickHouseExternalTable> tables, Map<String, String> settings) intexecuteUpdate(String sql) intexecuteUpdate(String sql, int autoGeneratedKeys) intexecuteUpdate(String sql, int[] columnIndexes) intexecuteUpdate(String sql, String[] columnNames) com.clickhouse.client.ClickHouseConfigprotected com.clickhouse.data.ClickHouseDataProcessorgetDataProcessor(com.clickhouse.data.ClickHouseInputStream input, Map<String, Serializable> settings, com.clickhouse.data.ClickHouseColumn[] columns) protected com.clickhouse.data.ClickHouseDataProcessorgetDataProcessor(com.clickhouse.data.ClickHouseOutputStream output, Map<String, Serializable> settings, com.clickhouse.data.ClickHouseColumn[] columns) intintprotected com.clickhouse.data.ClickHouseFilegetFile(com.clickhouse.data.ClickHouseFile f, ClickHouseSqlStatement stmt) longlongprotected ClickHouseSqlStatementintintbooleanbooleangetMoreResults(int current) intintcom.clickhouse.client.ClickHouseRequest<?>intintintintbooleanisClosed()booleanbooleanbooleanisWrapperFor(Class<?> iface) protected ClickHouseResultSetvoidoptionChanged(com.clickhouse.client.ClickHouseRequest<?> source, com.clickhouse.config.ClickHouseOption option, Serializable oldValue, Serializable newValue) protected ClickHouseSqlStatementparseSqlStatements(String sql) protected com.clickhouse.client.ClickHouseResponseprotected voidvoidsetCursorName(String name) voidsetEscapeProcessing(boolean enable) voidsetFetchDirection(int direction) voidsetFetchSize(int rows) voidsetLargeMaxRows(long max) protected voidvoidsetMaxFieldSize(int max) voidsetMaxRows(int max) voidsetNullAsDefault(int level) voidsetPoolable(boolean poolable) voidsetQueryTimeout(int seconds) voidsettingChanged(com.clickhouse.client.ClickHouseRequest<?> source, String setting, Serializable oldValue, Serializable newValue) <T> Tprotected ResultSetupdateResult(ClickHouseSqlStatement stmt, com.clickhouse.client.ClickHouseResponse response) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.clickhouse.config.ClickHouseConfigChangeListener
propertyChangedMethods inherited from interface com.clickhouse.jdbc.ClickHouseStatement
writeMethods inherited from interface java.sql.Statement
enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, isSimpleIdentifier
-
Field Details
-
mapper
-
parsedStmts
-
-
Constructor Details
-
ClickHouseStatementImpl
protected ClickHouseStatementImpl(ClickHouseConnectionImpl connection, com.clickhouse.client.ClickHouseRequest<?> request, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Throws:
SQLException
-
-
Method Details
-
ensureOpen
- Throws:
SQLException
-
getFile
protected com.clickhouse.data.ClickHouseFile getFile(com.clickhouse.data.ClickHouseFile f, ClickHouseSqlStatement stmt) -
processSqlStatement
protected com.clickhouse.client.ClickHouseResponse processSqlStatement(ClickHouseSqlStatement stmt) throws SQLException - Throws:
SQLException
-
executeStatement
protected com.clickhouse.client.ClickHouseResponse executeStatement(String stmt, Map<com.clickhouse.config.ClickHouseOption, Serializable> options, List<com.clickhouse.data.ClickHouseExternalTable> tables, Map<String, throws SQLExceptionString> settings) - Throws:
SQLException
-
executeStatement
protected com.clickhouse.client.ClickHouseResponse executeStatement(ClickHouseSqlStatement stmt, Map<com.clickhouse.config.ClickHouseOption, Serializable> options, List<com.clickhouse.data.ClickHouseExternalTable> tables, Map<String, throws SQLExceptionString> settings) - Throws:
SQLException
-
executeInsert
- Throws:
SQLException
-
getDataProcessor
protected com.clickhouse.data.ClickHouseDataProcessor getDataProcessor(com.clickhouse.data.ClickHouseInputStream input, Map<String, Serializable> settings, com.clickhouse.data.ClickHouseColumn[] columns) throws SQLException- Throws:
SQLException
-
getDataProcessor
protected com.clickhouse.data.ClickHouseDataProcessor getDataProcessor(com.clickhouse.data.ClickHouseOutputStream output, Map<String, Serializable> settings, com.clickhouse.data.ClickHouseColumn[] columns) throws SQLException- Throws:
SQLException
-
resetDataProcessor
protected void resetDataProcessor() -
getLastStatement
-
setLastStatement
-
parseSqlStatements
-
newEmptyResultSet
- Throws:
SQLException
-
updateResult
protected ResultSet updateResult(ClickHouseSqlStatement stmt, com.clickhouse.client.ClickHouseResponse response) throws SQLException - Throws:
SQLException
-
optionChanged
public void optionChanged(com.clickhouse.client.ClickHouseRequest<?> source, com.clickhouse.config.ClickHouseOption option, Serializable oldValue, Serializable newValue) - Specified by:
optionChangedin interfacecom.clickhouse.config.ClickHouseConfigChangeListener<com.clickhouse.client.ClickHouseRequest<?>>
-
settingChanged
public void settingChanged(com.clickhouse.client.ClickHouseRequest<?> source, String setting, Serializable oldValue, Serializable newValue) - Specified by:
settingChangedin interfacecom.clickhouse.config.ClickHouseConfigChangeListener<com.clickhouse.client.ClickHouseRequest<?>>
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
executeQuery
- Specified by:
executeQueryin interfaceStatement- Throws:
SQLException
-
executeLargeUpdate
- Specified by:
executeLargeUpdatein interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceStatement- Throws:
SQLException
-
getMaxFieldSize
- Specified by:
getMaxFieldSizein interfaceStatement- Throws:
SQLException
-
setMaxFieldSize
- Specified by:
setMaxFieldSizein interfaceStatement- Throws:
SQLException
-
getLargeMaxRows
- Specified by:
getLargeMaxRowsin interfaceStatement- Throws:
SQLException
-
getMaxRows
- Specified by:
getMaxRowsin interfaceStatement- Throws:
SQLException
-
setLargeMaxRows
- Specified by:
setLargeMaxRowsin interfaceStatement- Throws:
SQLException
-
setMaxRows
- Specified by:
setMaxRowsin interfaceStatement- Throws:
SQLException
-
setEscapeProcessing
- Specified by:
setEscapeProcessingin interfaceStatement- Throws:
SQLException
-
getQueryTimeout
- Specified by:
getQueryTimeoutin interfaceStatement- Throws:
SQLException
-
setQueryTimeout
- Specified by:
setQueryTimeoutin interfaceStatement- Throws:
SQLException
-
cancel
- Specified by:
cancelin interfaceStatement- Throws:
SQLException
-
getWarnings
- Specified by:
getWarningsin interfaceStatement- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarningsin interfaceStatement- Throws:
SQLException
-
setCursorName
- Specified by:
setCursorNamein interfaceStatement- Throws:
SQLException
-
getResultSet
- Specified by:
getResultSetin interfaceStatement- Throws:
SQLException
-
getLargeUpdateCount
- Specified by:
getLargeUpdateCountin interfaceStatement- Throws:
SQLException
-
getUpdateCount
- Specified by:
getUpdateCountin interfaceStatement- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResultsin interfaceStatement- Throws:
SQLException
-
setFetchDirection
- Specified by:
setFetchDirectionin interfaceStatement- Throws:
SQLException
-
getFetchDirection
- Specified by:
getFetchDirectionin interfaceStatement- Throws:
SQLException
-
setFetchSize
- Specified by:
setFetchSizein interfaceStatement- Throws:
SQLException
-
getFetchSize
- Specified by:
getFetchSizein interfaceStatement- Throws:
SQLException
-
getResultSetConcurrency
- Specified by:
getResultSetConcurrencyin interfaceStatement- Throws:
SQLException
-
getResultSetType
- Specified by:
getResultSetTypein interfaceStatement- Throws:
SQLException
-
addBatch
- Specified by:
addBatchin interfaceStatement- Throws:
SQLException
-
clearBatch
- Specified by:
clearBatchin interfaceStatement- Throws:
SQLException
-
executeBatch
- Specified by:
executeBatchin interfaceStatement- Throws:
SQLException
-
executeLargeBatch
- Specified by:
executeLargeBatchin interfaceStatement- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResultsin interfaceStatement- Throws:
SQLException
-
getGeneratedKeys
- Specified by:
getGeneratedKeysin interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
getResultSetHoldability
- Specified by:
getResultSetHoldabilityin interfaceStatement- Throws:
SQLException
-
isClosed
- Specified by:
isClosedin interfaceStatement- Throws:
SQLException
-
setPoolable
- Specified by:
setPoolablein interfaceStatement- Throws:
SQLException
-
isPoolable
- Specified by:
isPoolablein interfaceStatement- Throws:
SQLException
-
closeOnCompletion
- Specified by:
closeOnCompletionin interfaceStatement- Throws:
SQLException
-
isCloseOnCompletion
- Specified by:
isCloseOnCompletionin interfaceStatement- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceClickHouseStatement- Specified by:
getConnectionin interfaceStatement- Throws:
SQLException
-
getConfig
public com.clickhouse.client.ClickHouseConfig getConfig()- Specified by:
getConfigin interfaceClickHouseStatement
-
getNullAsDefault
public int getNullAsDefault()- Specified by:
getNullAsDefaultin interfaceClickHouseStatement
-
setNullAsDefault
public void setNullAsDefault(int level) - Specified by:
setNullAsDefaultin interfaceClickHouseStatement
-
getRequest
public com.clickhouse.client.ClickHouseRequest<?> getRequest()- Specified by:
getRequestin interfaceClickHouseStatement
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Overrides:
isWrapperForin classJdbcWrapper- Throws:
SQLException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Overrides:
unwrapin classJdbcWrapper- Throws:
SQLException
-