Package com.clickhouse.jdbc.internal
Class SqlBasedPreparedStatement
- java.lang.Object
-
- com.clickhouse.jdbc.JdbcWrapper
-
- com.clickhouse.jdbc.internal.ClickHouseStatementImpl
-
- com.clickhouse.jdbc.internal.SqlBasedPreparedStatement
-
- All Implemented Interfaces:
ClickHousePreparedStatement,ClickHouseStatement,AutoCloseable,PreparedStatement,Statement,Wrapper
public class SqlBasedPreparedStatement extends ClickHouseStatementImpl implements ClickHousePreparedStatement
-
-
Field Summary
-
Fields inherited from class com.clickhouse.jdbc.internal.ClickHouseStatementImpl
batchStmts, parsedStmts
-
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
Constructors Modifier Constructor Description protectedSqlBasedPreparedStatement(ClickHouseConnectionImpl connection, ClickHouseRequest<?> request, ClickHouseSqlStatement parsedStmt, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBatch()voidclearBatch()voidclearParameters()protected voidensureParams()booleanexecute()int[]executeBatch()protected int[]executeBatch(boolean keepLastResponse)ResultSetexecuteQuery()intexecuteUpdate()ParameterMetaDatagetParameterMetaData()voidsetArray(int parameterIndex, Array x)voidsetBigDecimal(int parameterIndex, BigDecimal x)voidsetByte(int parameterIndex, byte x)voidsetBytes(int parameterIndex, byte[] x)voidsetDate(int parameterIndex, Date x, Calendar cal)voidsetDouble(int parameterIndex, double x)voidsetFloat(int parameterIndex, float x)voidsetInt(int parameterIndex, int x)voidsetLong(int parameterIndex, long x)voidsetNull(int parameterIndex, int sqlType, String typeName)voidsetObject(int parameterIndex, Object x)voidsetObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength)voidsetShort(int parameterIndex, short x)voidsetString(int parameterIndex, String x)voidsetTime(int parameterIndex, Time x, Calendar cal)voidsetTimestamp(int parameterIndex, Timestamp x, Calendar cal)protected inttoArrayIndex(int parameterIndex)-
Methods inherited from class com.clickhouse.jdbc.internal.ClickHouseStatementImpl
addBatch, cancel, clearWarnings, close, closeOnCompletion, ensureOpen, execute, execute, execute, execute, executeInsert, executeQuery, executeStatement, executeStatement, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConfig, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLastStatement, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getRequest, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isWrapperFor, parseSqlStatements, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLastStatement, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unwrap, updateResult
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.clickhouse.jdbc.ClickHousePreparedStatement
addBatch, getMetaData, setAsciiStream, setAsciiStream, setAsciiStream, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setObject, setRef, setRowId, setSQLXML, setTime, setTimestamp, setUnicodeStream, setURL
-
Methods inherited from interface com.clickhouse.jdbc.ClickHouseStatement
write
-
Methods inherited from interface java.sql.PreparedStatement
executeLargeUpdate, setObject, setObject
-
Methods inherited from interface java.sql.Statement
cancel, clearWarnings, close, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
-
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
-
-
-
Constructor Detail
-
SqlBasedPreparedStatement
protected SqlBasedPreparedStatement(ClickHouseConnectionImpl connection, ClickHouseRequest<?> request, ClickHouseSqlStatement parsedStmt, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- Throws:
SQLException
-
-
Method Detail
-
ensureParams
protected void ensureParams() throws SQLException- Throws:
SQLException
-
executeBatch
protected int[] executeBatch(boolean keepLastResponse) throws SQLException- Throws:
SQLException
-
toArrayIndex
protected int toArrayIndex(int parameterIndex) throws SQLException- Throws:
SQLException
-
executeQuery
public ResultSet executeQuery() throws SQLException
- Specified by:
executeQueryin interfacePreparedStatement- Throws:
SQLException
-
executeUpdate
public int executeUpdate() throws SQLException- Specified by:
executeUpdatein interfacePreparedStatement- Throws:
SQLException
-
setByte
public void setByte(int parameterIndex, byte x) throws SQLException- Specified by:
setBytein interfacePreparedStatement- Throws:
SQLException
-
setShort
public void setShort(int parameterIndex, short x) throws SQLException- Specified by:
setShortin interfacePreparedStatement- Throws:
SQLException
-
setInt
public void setInt(int parameterIndex, int x) throws SQLException- Specified by:
setIntin interfacePreparedStatement- Throws:
SQLException
-
setLong
public void setLong(int parameterIndex, long x) throws SQLException- Specified by:
setLongin interfacePreparedStatement- Throws:
SQLException
-
setFloat
public void setFloat(int parameterIndex, float x) throws SQLException- Specified by:
setFloatin interfacePreparedStatement- Throws:
SQLException
-
setDouble
public void setDouble(int parameterIndex, double x) throws SQLException- Specified by:
setDoublein interfacePreparedStatement- Throws:
SQLException
-
setBigDecimal
public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException- Specified by:
setBigDecimalin interfacePreparedStatement- Throws:
SQLException
-
setString
public void setString(int parameterIndex, String x) throws SQLException- Specified by:
setStringin interfacePreparedStatement- Throws:
SQLException
-
setBytes
public void setBytes(int parameterIndex, byte[] x) throws SQLException- Specified by:
setBytesin interfacePreparedStatement- Throws:
SQLException
-
clearParameters
public void clearParameters() throws SQLException- Specified by:
clearParametersin interfacePreparedStatement- Throws:
SQLException
-
setObject
public void setObject(int parameterIndex, Object x) throws SQLException- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
execute
public boolean execute() throws SQLException- Specified by:
executein interfaceClickHousePreparedStatement- Specified by:
executein interfacePreparedStatement- Throws:
SQLException
-
addBatch
public void addBatch() throws SQLException- Specified by:
addBatchin interfacePreparedStatement- Throws:
SQLException
-
executeBatch
public int[] executeBatch() throws SQLException- Specified by:
executeBatchin interfaceStatement- Overrides:
executeBatchin classClickHouseStatementImpl- Throws:
SQLException
-
clearBatch
public void clearBatch() throws SQLException- Specified by:
clearBatchin interfaceStatement- Overrides:
clearBatchin classClickHouseStatementImpl- Throws:
SQLException
-
setArray
public void setArray(int parameterIndex, Array x) throws SQLException- Specified by:
setArrayin interfacePreparedStatement- Throws:
SQLException
-
setDate
public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException- Specified by:
setDatein interfacePreparedStatement- Throws:
SQLException
-
setTime
public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException- Specified by:
setTimein interfacePreparedStatement- Throws:
SQLException
-
setTimestamp
public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException- Specified by:
setTimestampin interfacePreparedStatement- Throws:
SQLException
-
setNull
public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException- Specified by:
setNullin interfacePreparedStatement- Throws:
SQLException
-
getParameterMetaData
public ParameterMetaData getParameterMetaData() throws SQLException
- Specified by:
getParameterMetaDatain interfacePreparedStatement- Throws:
SQLException
-
setObject
public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException- Specified by:
setObjectin interfacePreparedStatement- Throws:
SQLException
-
-