Class FunctionStatement

All Implemented Interfaces:
AutoCloseable, CallableStatement, PreparedStatement, Statement, Wrapper

public class FunctionStatement extends BaseCallableStatement implements CallableStatement
Function callable statement implementation
  • Constructor Details

    • FunctionStatement

      public FunctionStatement(Connection con, String databaseName, String procedureName, String arguments, ClosableLock lock, int resultSetType, int resultSetConcurrency) throws SQLException
      Constructor of function callable statement
      Parameters:
      con - current connection
      databaseName - database
      procedureName - procedure
      arguments - arguments
      lock - thread lock object
      resultSetType - result set type
      resultSetConcurrency - concurrency type
      Throws:
      SQLException - if any error occurs
  • Method Details

    • isFunction

      public boolean isFunction()
      Description copied from class: BaseCallableStatement
      Indicate if callable statement is a function or a stored procedure
      Specified by:
      isFunction in class BaseCallableStatement
      Returns:
      indicate if is a function
    • handleParameterOutput

      protected void handleParameterOutput() throws SQLException
      Description copied from class: ServerPreparedStatement
      Handle output parameter result-set (only for CallableStatement)
      Overrides:
      handleParameterOutput in class ServerPreparedStatement
      Throws:
      SQLException - if any error occurs
    • registerOutParameter

      public void registerOutParameter(int index, int sqlType) throws SQLException
      Description copied from class: BaseCallableStatement
      Registers the OUT parameter in ordinal position parameterIndex to the JDBC type sqlType. All OUT parameters must be registered before a stored procedure is executed.

      The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that parameter.

      If the JDBC type expected to be returned to this output parameter is specific to this particular database, sqlType should be java.sql.Types.OTHER. The method BaseCallableStatement.getObject(int) retrieves the value.

      Specified by:
      registerOutParameter in interface CallableStatement
      Overrides:
      registerOutParameter in class BaseCallableStatement
      Parameters:
      index - the first parameter is 1, the second is 2, and so on
      sqlType - the JDBC type code defined by java.sql.Types. If the parameter is of JDBC type NUMERIC or DECIMAL, the version of registerOutParameter that accepts a scale value should be used.
      Throws:
      SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closed CallableStatement
      See Also:
    • executeInternal

      protected void executeInternal() throws SQLException
      Description copied from class: ServerPreparedStatement
      Execute command with parameters
      Overrides:
      executeInternal in class ServerPreparedStatement
      Throws:
      SQLException - if any error occurs
    • preValidParameters

      protected void preValidParameters() throws SQLException
      Ensures that returning value is not taken as a parameter.
      Throws:
      SQLException - if any exception
    • toString

      public String toString()
      Overrides:
      toString in class ServerPreparedStatement