Interface IDatabricksStatement
- All Superinterfaces:
AutoCloseable,Statement,Wrapper
- All Known Implementing Classes:
DatabricksPreparedStatement,DatabricksStatement
Extends the standard JDBC
Statement interface to provide Databricks-specific
functionality. This interface adds support for asynchronous query execution and result retrieval,
allowing for better handling of long-running queries and improved performance in distributed
environments.-
Field Summary
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 -
Method Summary
Modifier and TypeMethodDescriptionexecuteAsync(String sql) Executes the given SQL command asynchronously and returns a lightweight result set handle.Retrieves the result set for a previously executed statement.Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, 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, setQueryTimeoutMethods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Method Details
-
executeAsync
Executes 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 usinggetExecutionResult().- 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
Retrieves the result set for a previously executed statement. This method should be called after executing a statement usingexecuteAsync(String)to get the actual results.- 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
-