Interface ResultSetReturn


  • public interface ResultSetReturn
    Contract for extracting ResultSets from Statements, executing Statements, managing Statement/ResultSet resources, and logging statement calls. TODO: This could eventually utilize the new Return interface. It would be great to have a common API shared. Generally the methods here dealing with CallableStatement are extremely limited, relying on the legacy
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.sql.ResultSet execute​(java.sql.PreparedStatement statement)
      Execute the PreparedStatement return its first ResultSet, if any.
      java.sql.ResultSet execute​(java.sql.Statement statement, java.lang.String sql)
      Performs the given SQL statement, returning its first ResultSet, if any.
      int executeUpdate​(java.sql.PreparedStatement statement)
      Execute the PreparedStatement, returning its "affected row count".
      int executeUpdate​(java.sql.Statement statement, java.lang.String sql)
      Execute the given SQL statement returning its "affected row count".
      java.sql.ResultSet extract​(java.sql.CallableStatement callableStatement)
      Extract the ResultSet from the CallableStatement.
      java.sql.ResultSet extract​(java.sql.PreparedStatement statement)
      Extract the ResultSet from the PreparedStatement.
      java.sql.ResultSet extract​(java.sql.Statement statement, java.lang.String sql)
      Performs the given SQL statement, expecting a ResultSet in return
    • Method Detail

      • extract

        java.sql.ResultSet extract​(java.sql.PreparedStatement statement)
        Extract the ResultSet from the PreparedStatement.

        If user passes CallableStatement reference, this method calls extract(CallableStatement) internally. Otherwise, generally speaking, PreparedStatement.executeQuery() is called

        Parameters:
        statement - The PreparedStatement from which to extract the ResultSet
        Returns:
        The extracted ResultSet
      • extract

        java.sql.ResultSet extract​(java.sql.CallableStatement callableStatement)
        Extract the ResultSet from the CallableStatement. Note that this is the limited legacy form which delegates to Dialect.getResultSet(java.sql.CallableStatement). Better option is to integrate ProcedureCall-like hooks
        Parameters:
        callableStatement - The CallableStatement from which to extract the ResultSet
        Returns:
        The extracted ResultSet
      • extract

        java.sql.ResultSet extract​(java.sql.Statement statement,
                                   java.lang.String sql)
        Performs the given SQL statement, expecting a ResultSet in return
        Parameters:
        statement - The JDBC Statement object to use
        sql - The SQL to execute
        Returns:
        The resulting ResultSet
      • execute

        java.sql.ResultSet execute​(java.sql.PreparedStatement statement)
        Execute the PreparedStatement return its first ResultSet, if any. If there is no ResultSet, returns null
        Parameters:
        statement - The PreparedStatement to execute
        Returns:
        The extracted ResultSet, or null
      • execute

        java.sql.ResultSet execute​(java.sql.Statement statement,
                                   java.lang.String sql)
        Performs the given SQL statement, returning its first ResultSet, if any. If there is no ResultSet, returns null
        Parameters:
        statement - The JDBC Statement object to use
        sql - The SQL to execute
        Returns:
        The extracted ResultSet, or null
      • executeUpdate

        int executeUpdate​(java.sql.PreparedStatement statement)
        Execute the PreparedStatement, returning its "affected row count".
        Parameters:
        statement - The PreparedStatement to execute
        Returns:
        The PreparedStatement.executeUpdate() result
      • executeUpdate

        int executeUpdate​(java.sql.Statement statement,
                          java.lang.String sql)
        Execute the given SQL statement returning its "affected row count".
        Parameters:
        statement - The JDBC Statement object to use
        sql - The SQL to execute
        Returns:
        The Statement.executeUpdate(String) result