Interface IDatabricksStatement

  • All Superinterfaces:
    AutoCloseable, Statement, Wrapper
    All Known Implementing Classes:
    DatabricksPreparedStatement, DatabricksStatement

    public interface IDatabricksStatement
    extends Statement
    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.
    • Method Detail

      • executeAsync

        ResultSet executeAsync​(String sql)
                        throws SQLException
        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 using getExecutionResult().
        Parameters:
        sql - The SQL command to be executed
        Returns:
        A ResultSet handle 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

        ResultSet getExecutionResult()
                              throws SQLException
        Retrieves the result set for a previously executed statement. This method should be called after executing a statement using executeAsync(String) to get the actual results.
        Returns:
        A ResultSet containing 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