Class DatabricksStatement
java.lang.Object
com.databricks.jdbc.api.impl.DatabricksStatement
- All Implemented Interfaces:
IDatabricksStatement,IDatabricksStatementInternal,AutoCloseable,Statement,Wrapper
- Direct Known Subclasses:
DatabricksPreparedStatement
public class DatabricksStatement
extends Object
implements IDatabricksStatement, IDatabricksStatementInternal
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionDatabricksStatement(DatabricksConnection connection) DatabricksStatement(DatabricksConnection connection, StatementId statementId) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidallowInputStreamForVolumeOperation(boolean allowInputStream) voidcancel()voidvoidvoidclose()voidclose(boolean removeFromSession) voidenquoteIdentifier(String identifier, boolean alwaysQuote) enquoteLiteral(String val) booleanbooleanbooleanbooleanexecuteAsync(String sql) Executes the given SQL command asynchronously and returns a lightweight result set handle.int[]long[]longexecuteLargeUpdate(String sql) longexecuteLargeUpdate(String sql, int autoGeneratedKeys) longexecuteLargeUpdate(String sql, int[] columnIndexes) longexecuteLargeUpdate(String sql, String[] columnNames) executeQuery(String sql) intexecuteUpdate(String sql) intexecuteUpdate(String sql, int autoGeneratedKeys) intexecuteUpdate(String sql, int[] columnIndexes) intexecuteUpdate(String sql, String[] columnNames) Retrieves the result set for a previously executed statement.intintorg.apache.http.entity.InputStreamEntitylonglongintintbooleanbooleangetMoreResults(int current) intintintintintvoidhandleResultSetClose(IDatabricksResultSet resultSet) booleanbooleanisClosed()booleanbooleanbooleanisSimpleIdentifier(String identifier) booleanisWrapperFor(Class<?> iface) voidsetCursorName(String name) voidsetEscapeProcessing(boolean enable) voidsetFetchDirection(int direction) voidsetFetchSize(int rows) voidsetInputStreamForUCVolume(org.apache.http.entity.InputStreamEntity inputStream) voidsetLargeMaxRows(long max) voidsetMaxFieldSize(int max) voidsetMaxRows(int max) voidsetPoolable(boolean poolable) voidsetQueryTimeout(int seconds) voidsetStatementId(StatementId statementId) toString()<T> T
-
Field Details
-
connection
-
-
Constructor Details
-
DatabricksStatement
-
DatabricksStatement
-
-
Method Details
-
executeQuery
- Specified by:
executeQueryin interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
executeLargeUpdate
- Specified by:
executeLargeUpdatein interfaceStatement- Throws:
SQLException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceStatement- Throws:
SQLException
-
close
- Specified by:
closein interfaceIDatabricksStatementInternal- Throws:
DatabricksSQLException
-
getMaxFieldSize
- Specified by:
getMaxFieldSizein interfaceStatement- Throws:
SQLException
-
setMaxFieldSize
- Specified by:
setMaxFieldSizein interfaceStatement- Throws:
SQLException
-
getMaxRows
- Specified by:
getMaxRowsin interfaceIDatabricksStatementInternal- Specified by:
getMaxRowsin interfaceStatement- Throws:
DatabricksSQLException
-
getLargeMaxRows
- Specified by:
getLargeMaxRowsin interfaceStatement- Throws:
DatabricksSQLException
-
setMaxRows
- Specified by:
setMaxRowsin interfaceStatement- Throws:
SQLException
-
setLargeMaxRows
- Specified by:
setLargeMaxRowsin 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
-
clearWarnings
public void clearWarnings()- Specified by:
clearWarningsin interfaceStatement
-
setCursorName
- Specified by:
setCursorNamein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
getResultSet
- Specified by:
getResultSetin interfaceStatement- Throws:
SQLException
-
getUpdateCount
- Specified by:
getUpdateCountin interfaceStatement- Throws:
SQLException
-
getLargeUpdateCount
- Specified by:
getLargeUpdateCountin 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
public void setFetchSize(int rows) - Specified by:
setFetchSizein interfaceStatement
-
getFetchSize
public int getFetchSize()- Specified by:
getFetchSizein interfaceStatement
-
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
-
getConnection
- Specified by:
getConnectionin interfaceStatement- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResultsin interfaceStatement- Throws:
SQLException
-
getGeneratedKeys
- Specified by:
getGeneratedKeysin interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
executeLargeUpdate
- Specified by:
executeLargeUpdatein interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
executeLargeUpdate
- Specified by:
executeLargeUpdatein interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
executeLargeUpdate
- Specified by:
executeLargeUpdatein 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
public int getResultSetHoldability()- Specified by:
getResultSetHoldabilityin interfaceStatement
-
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
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
handleResultSetClose
- Specified by:
handleResultSetClosein interfaceIDatabricksStatementInternal- Throws:
DatabricksSQLException
-
setStatementId
- Specified by:
setStatementIdin interfaceIDatabricksStatementInternal
-
getStatementId
- Specified by:
getStatementIdin interfaceIDatabricksStatementInternal
-
getStatement
- Specified by:
getStatementin interfaceIDatabricksStatementInternal
-
allowInputStreamForVolumeOperation
public void allowInputStreamForVolumeOperation(boolean allowInputStream) throws DatabricksSQLException - Specified by:
allowInputStreamForVolumeOperationin interfaceIDatabricksStatementInternal- Throws:
DatabricksSQLException
-
isAllowedInputStreamForVolumeOperation
- Specified by:
isAllowedInputStreamForVolumeOperationin interfaceIDatabricksStatementInternal- Throws:
DatabricksSQLException
-
setInputStreamForUCVolume
public void setInputStreamForUCVolume(org.apache.http.entity.InputStreamEntity inputStream) throws DatabricksSQLException - Specified by:
setInputStreamForUCVolumein interfaceIDatabricksStatementInternal- Throws:
DatabricksSQLException
-
getInputStreamForUCVolume
public org.apache.http.entity.InputStreamEntity getInputStreamForUCVolume() throws DatabricksSQLException- Specified by:
getInputStreamForUCVolumein interfaceIDatabricksStatementInternal- Throws:
DatabricksSQLException
-
executeAsync
Description copied from interface:IDatabricksStatementExecutes the given SQL command asynchronously and returns a lightweight result set handle. This method initiates the execution but does not wait for it to complete, making it suitable for long-running queries. The actual results can be retrieved later usingIDatabricksStatement.getExecutionResult().- Specified by:
executeAsyncin interfaceIDatabricksStatement- Parameters:
sql- The SQL command to be executed- Returns:
- A
ResultSethandle that can be used to track and retrieve the results - Throws:
SQLException- if a database access error occurs, this method is called on a closed statement, or the SQL command is not valid
-
getExecutionResult
Description copied from interface:IDatabricksStatementRetrieves the result set for a previously executed statement. This method should be called after executing a statement usingIDatabricksStatement.executeAsync(String)to get the actual results.- Specified by:
getExecutionResultin interfaceIDatabricksStatement- Returns:
- A
ResultSetcontaining the results of the statement execution in case of successful completion, else handle for the result status. - Throws:
SQLException- if the statement was never executed, has been closed, or if a database access error occurs
-
enquoteLiteral
- Specified by:
enquoteLiteralin interfaceStatement- Throws:
SQLException
-
enquoteIdentifier
public String enquoteIdentifier(String identifier, boolean alwaysQuote) throws DatabricksSQLException - Specified by:
enquoteIdentifierin interfaceStatement- Throws:
DatabricksSQLException
-
enquoteNCharLiteral
- Specified by:
enquoteNCharLiteralin interfaceStatement- Throws:
SQLException
-
isSimpleIdentifier
- Specified by:
isSimpleIdentifierin interfaceStatement- Throws:
SQLException
-
toString
-