public class ClickHouseStatementImpl extends Object implements ClickHouseStatement
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ClickHouseStatementImpl.WrappedHttpEntity |
| Modifier and Type | Field and Description |
|---|---|
protected List<ClickHouseSqlStatement> |
batchStmts |
protected String |
currentDatabase
Current database name may be changed by
Connection.setCatalog(String)
between creation of this object and query execution, but javadoc does not allow
setCatalog influence on already created statements. |
protected ClickHouseSqlStatement[] |
parsedStmts |
protected ClickHouseProperties |
properties |
protected ClickHouseStatementImpl |
statement |
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO| Constructor and Description |
|---|
ClickHouseStatementImpl(org.apache.http.impl.client.CloseableHttpClient client,
ClickHouseConnection connection,
ClickHouseProperties properties,
int resultSetType) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecuteLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, getLargeMaxRows, getLargeUpdateCount, setLargeMaxRowsprotected ClickHouseProperties properties
protected ClickHouseSqlStatement[] parsedStmts
protected List<ClickHouseSqlStatement> batchStmts
protected String currentDatabase
Connection.setCatalog(String)
between creation of this object and query execution, but javadoc does not allow
setCatalog influence on already created statements.protected final ClickHouseStatementImpl statement
public ClickHouseStatementImpl(org.apache.http.impl.client.CloseableHttpClient client,
ClickHouseConnection connection,
ClickHouseProperties properties,
int resultSetType)
protected ClickHouseSqlStatement getLastStatement()
protected void setLastStatement(ClickHouseSqlStatement stmt)
protected ClickHouseSqlStatement[] parseSqlStatements(String sql) throws SQLException
SQLExceptionprotected ClickHouseSqlStatement parseSqlStatements(String sql, ClickHouseFormat preferredFormat, Map<ClickHouseQueryParam,String> additionalDBParams) throws SQLException
SQLExceptionprotected ClickHouseSqlStatement applyFormat(ClickHouseSqlStatement stmt, ClickHouseFormat preferredFormat)
protected Map<ClickHouseQueryParam,String> importAdditionalDBParameters(Map<ClickHouseQueryParam,String> additionalDBParams)
protected ResultSet updateResult(ClickHouseSqlStatement stmt, InputStream is) throws IOException, ClickHouseException
IOExceptionClickHouseExceptionprotected int executeStatement(ClickHouseSqlStatement stmt, Map<ClickHouseQueryParam,String> additionalDBParams, List<ClickHouseExternalData> externalData, Map<String,String> additionalRequestParams) throws SQLException
SQLExceptionprotected ResultSet executeQueryStatement(ClickHouseSqlStatement stmt, Map<ClickHouseQueryParam,String> additionalDBParams, List<ClickHouseExternalData> externalData, Map<String,String> additionalRequestParams) throws SQLException
SQLExceptionprotected ClickHouseResponse executeQueryClickhouseResponse(ClickHouseSqlStatement stmt, Map<ClickHouseQueryParam,String> additionalDBParams, Map<String,String> additionalRequestParams) throws SQLException
SQLExceptionpublic ResultSet executeQuery(String sql) throws SQLException
executeQuery in interface StatementSQLExceptionpublic ResultSet executeQuery(String sql, Map<ClickHouseQueryParam,String> additionalDBParams) throws SQLException
executeQuery in interface ClickHouseStatementSQLExceptionpublic ResultSet executeQuery(String sql, Map<ClickHouseQueryParam,String> additionalDBParams, List<ClickHouseExternalData> externalData) throws SQLException
executeQuery in interface ClickHouseStatementSQLExceptionpublic ResultSet executeQuery(String sql, Map<ClickHouseQueryParam,String> additionalDBParams, List<ClickHouseExternalData> externalData, Map<String,String> additionalRequestParams) throws SQLException
executeQuery in interface ClickHouseStatementSQLExceptionpublic ClickHouseResponse executeQueryClickhouseResponse(String sql) throws SQLException
executeQueryClickhouseResponse in interface ClickHouseStatementSQLExceptionpublic ClickHouseResponse executeQueryClickhouseResponse(String sql, Map<ClickHouseQueryParam,String> additionalDBParams) throws SQLException
executeQueryClickhouseResponse in interface ClickHouseStatementSQLExceptionpublic ClickHouseResponse executeQueryClickhouseResponse(String sql, Map<ClickHouseQueryParam,String> additionalDBParams, Map<String,String> additionalRequestParams) throws SQLException
executeQueryClickhouseResponse in interface ClickHouseStatementSQLExceptionpublic ClickHouseRowBinaryInputStream executeQueryClickhouseRowBinaryStream(String sql) throws SQLException
executeQueryClickhouseRowBinaryStream in interface ClickHouseStatementSQLExceptionpublic ClickHouseRowBinaryInputStream executeQueryClickhouseRowBinaryStream(String sql, Map<ClickHouseQueryParam,String> additionalDBParams) throws SQLException
executeQueryClickhouseRowBinaryStream in interface ClickHouseStatementSQLExceptionpublic ClickHouseRowBinaryInputStream executeQueryClickhouseRowBinaryStream(String sql, Map<ClickHouseQueryParam,String> additionalDBParams, Map<String,String> additionalRequestParams) throws SQLException
executeQueryClickhouseRowBinaryStream in interface ClickHouseStatementSQLExceptionpublic int executeUpdate(String sql) throws SQLException
executeUpdate in interface StatementSQLExceptionpublic boolean execute(String sql) throws SQLException
execute in interface StatementSQLExceptionpublic void close()
throws SQLException
close in interface AutoCloseableclose in interface StatementSQLExceptionpublic int getMaxFieldSize()
throws SQLException
getMaxFieldSize in interface StatementSQLExceptionpublic void setMaxFieldSize(int max)
throws SQLException
setMaxFieldSize in interface StatementSQLExceptionpublic int getMaxRows()
throws SQLException
getMaxRows in interface StatementSQLExceptionpublic void setMaxRows(int max)
throws SQLException
setMaxRows in interface StatementSQLExceptionpublic void setEscapeProcessing(boolean enable)
throws SQLException
setEscapeProcessing in interface StatementSQLExceptionpublic int getQueryTimeout()
throws SQLException
getQueryTimeout in interface StatementSQLExceptionpublic void setQueryTimeout(int seconds)
throws SQLException
setQueryTimeout in interface StatementSQLExceptionpublic void cancel()
throws SQLException
cancel in interface StatementSQLExceptionpublic SQLWarning getWarnings() throws SQLException
getWarnings in interface StatementSQLExceptionpublic void clearWarnings()
throws SQLException
clearWarnings in interface StatementSQLExceptionpublic void setCursorName(String name) throws SQLException
setCursorName in interface StatementSQLExceptionpublic ResultSet getResultSet() throws SQLException
getResultSet in interface StatementSQLExceptionpublic int getUpdateCount()
throws SQLException
getUpdateCount in interface StatementSQLExceptionpublic boolean getMoreResults()
throws SQLException
getMoreResults in interface StatementSQLExceptionpublic void setFetchDirection(int direction)
throws SQLException
setFetchDirection in interface StatementSQLExceptionpublic int getFetchDirection()
throws SQLException
getFetchDirection in interface StatementSQLExceptionpublic void setFetchSize(int rows)
throws SQLException
setFetchSize in interface StatementSQLExceptionpublic int getFetchSize()
throws SQLException
getFetchSize in interface StatementSQLExceptionpublic int getResultSetConcurrency()
throws SQLException
getResultSetConcurrency in interface StatementSQLExceptionpublic int getResultSetType()
throws SQLException
getResultSetType in interface StatementSQLExceptionpublic void addBatch(String sql) throws SQLException
addBatch in interface StatementSQLExceptionpublic void clearBatch()
throws SQLException
clearBatch in interface StatementSQLExceptionpublic int[] executeBatch()
throws SQLException
executeBatch in interface StatementSQLExceptionpublic ClickHouseConnection getConnection() throws ClickHouseException
getConnection in interface StatementClickHouseExceptionpublic boolean getMoreResults(int current)
throws SQLException
getMoreResults in interface StatementSQLExceptionpublic ResultSet getGeneratedKeys() throws SQLException
getGeneratedKeys in interface StatementSQLExceptionpublic int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
executeUpdate in interface StatementSQLExceptionpublic int executeUpdate(String sql, int[] columnIndexes) throws SQLException
executeUpdate in interface StatementSQLExceptionpublic int executeUpdate(String sql, String[] columnNames) throws SQLException
executeUpdate in interface StatementSQLExceptionpublic boolean execute(String sql, int autoGeneratedKeys) throws SQLException
execute in interface StatementSQLExceptionpublic boolean execute(String sql, int[] columnIndexes) throws SQLException
execute in interface StatementSQLExceptionpublic boolean execute(String sql, String[] columnNames) throws SQLException
execute in interface StatementSQLExceptionpublic int getResultSetHoldability()
throws SQLException
getResultSetHoldability in interface StatementSQLExceptionpublic boolean isClosed()
throws SQLException
isClosed in interface StatementSQLExceptionpublic void setPoolable(boolean poolable)
throws SQLException
setPoolable in interface StatementSQLExceptionpublic boolean isPoolable()
throws SQLException
isPoolable in interface StatementSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic ClickHouseResponseSummary getResponseSummary()
getResponseSummary in interface ClickHouseStatementpublic void sendRowBinaryStream(String sql, ClickHouseStreamCallback callback) throws SQLException
sendRowBinaryStream in interface ClickHouseStatementSQLExceptionpublic void sendRowBinaryStream(String sql, Map<ClickHouseQueryParam,String> additionalDBParams, ClickHouseStreamCallback callback) throws SQLException
sendRowBinaryStream in interface ClickHouseStatementSQLExceptionpublic void sendNativeStream(String sql, ClickHouseStreamCallback callback) throws SQLException
sendNativeStream in interface ClickHouseStatementSQLExceptionpublic void sendNativeStream(String sql, Map<ClickHouseQueryParam,String> additionalDBParams, ClickHouseStreamCallback callback) throws SQLException
sendNativeStream in interface ClickHouseStatementSQLExceptionpublic void sendCSVStream(InputStream content, String table, Map<ClickHouseQueryParam,String> additionalDBParams) throws SQLException
sendCSVStream in interface ClickHouseStatementSQLExceptionpublic void sendCSVStream(InputStream content, String table) throws SQLException
sendCSVStream in interface ClickHouseStatementSQLExceptionpublic void sendStream(InputStream content, String table) throws SQLException
sendStream in interface ClickHouseStatementSQLExceptionpublic void sendStream(InputStream content, String table, Map<ClickHouseQueryParam,String> additionalDBParams) throws SQLException
sendStream in interface ClickHouseStatementSQLException@Deprecated public void sendStream(org.apache.http.HttpEntity content, String sql) throws ClickHouseException
ClickHouseException@Deprecated public void sendStream(org.apache.http.HttpEntity content, String sql, Map<ClickHouseQueryParam,String> additionalDBParams) throws ClickHouseException
ClickHouseExceptionpublic void sendStreamSQL(InputStream content, String sql, Map<ClickHouseQueryParam,String> additionalDBParams) throws SQLException
sendStreamSQL in interface ClickHouseStatementSQLExceptionpublic void sendStreamSQL(InputStream content, String sql) throws SQLException
sendStreamSQL in interface ClickHouseStatementSQLExceptionpublic void closeOnCompletion()
throws SQLException
closeOnCompletion in interface StatementSQLExceptionpublic boolean isCloseOnCompletion()
throws SQLException
isCloseOnCompletion in interface StatementSQLExceptionpublic Writer write()
ClickHouseStatementwrite in interface ClickHouseStatementWriter builder object which can be used to
construct a request to the serverpublic T addDbParam(ClickHouseQueryParam param, String value)
public T removeDbParam(ClickHouseQueryParam param)
public T withDbParams(Map<ClickHouseQueryParam,String> dbParams)
public T removeOption(String key)
Copyright © 2015–2021 ClickHouse. All rights reserved.