Package org.mariadb.jdbc

## Class FunctionStatement

- java.lang.Object
- - org.mariadb.jdbc.Statement
  - - org.mariadb.jdbc.BasePreparedStatement
    - - org.mariadb.jdbc.ServerPreparedStatement
      - - org.mariadb.jdbc.BaseCallableStatement
        - - org.mariadb.jdbc.FunctionStatement

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

    public class FunctionStatement
    extends BaseCallableStatement
    implements CallableStatement

Function callable statement implementation

### Field Summary

### Fields inherited from class org.mariadb.jdbc.BaseCallableStatement

`databaseName, outputParameters, parameterMetaData, procedureName`

### Fields inherited from class org.mariadb.jdbc.BasePreparedStatement

`batchParameters, parameters, prepareResult, sql`

### Fields inherited from class org.mariadb.jdbc.Statement

`autoGeneratedKeys, canUseServerMaxRows, canUseServerTimeout, closed, closeOnCompletion, con, currResult, escape, fetchSize, lock, maxRows, queryTimeout, results, resultSetConcurrency, resultSetType`

### 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`

### Constructor Summary

Constructors
`FunctionStatement​(Connection con, String databaseName, String procedureName, String arguments, ReentrantLock lock, boolean canUseServerTimeout, boolean canUseServerMaxRows, int resultSetType, int resultSetConcurrency)` Constructor of function callable statement

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `executeInternal()` Execute command with parameters
`protected void` `handleParameterOutput()` Handle output parameter result-set (only for CallableStatement)
`boolean` `isFunction()` Indicate if callable statement is a function or a stored procedure
`protected void` `preValidParameters()` Ensures that returning value is not taken as a parameter.
`void` `registerOutParameter​(int index, int sqlType)` Registers the OUT parameter in ordinal position `parameterIndex` to the JDBC type `sqlType`.

### Methods inherited from class org.mariadb.jdbc.BaseCallableStatement

`checkOutputResult, getArray, getArray, getBigDecimal, getBigDecimal, getBigDecimal, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getDate, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getParameterMetaData, getRef, getRef, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getURL, getURL, outputResultFromRes, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setURL, wasNull`

### Methods inherited from class org.mariadb.jdbc.ServerPreparedStatement

`addBatch, close, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeQuery, executeUpdate, getMetaData, reset, setLargeMaxRows, setMaxRows, setQueryTimeout, validParameters`

### Methods inherited from class org.mariadb.jdbc.BasePreparedStatement

`addBatch, clearParameters, execute, execute, execute, execute, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getMeta, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setParameter, setParameters, setPrepareResult, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL, updateMeta`

### Methods inherited from class org.mariadb.jdbc.Statement

`abort, cancel, checkNotClosed, clearBatch, clearWarnings, closeOnCompletion, escapeTimeout, executeInternalBatchPipeline, executeInternalBatchStandard, fetchRemaining, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isWrapperFor, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setPoolable, unwrap`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.sql.CallableStatement

`getArray, getArray, getBigDecimal, getBigDecimal, getBigDecimal, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getDate, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getURL, getURL, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, registerOutParameter, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setURL, wasNull`

### Methods inherited from interface java.sql.PreparedStatement

`addBatch, clearParameters, execute, executeLargeUpdate, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL`

### 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, setQueryTimeout`

### Methods inherited from interface java.sql.Wrapper

`isWrapperFor, unwrap`

### Constructor Detail

#### FunctionStatement

    public FunctionStatement​(Connection con,
                             String databaseName,
                             String procedureName,
                             String arguments,
                             ReentrantLock lock,
                             boolean canUseServerTimeout,
                             boolean canUseServerMaxRows,
                             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
  `canUseServerTimeout` - can use server timeout
  `canUseServerMaxRows` - can use server max rows
  `resultSetType` - result set type
  `resultSetConcurrency` - concurrency type
Throws:
  `SQLException` - if any error occurs

### Method Detail

#### 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`
  `SQLFeatureNotSupportedException` - if `sqlType` is a `ARRAY`, `BLOB`, `CLOB`, `DATALINK`, `JAVA_OBJECT`, `NCHAR`, `NCLOB`, `NVARCHAR`, `LONGNVARCHAR`, `REF`, `ROWID`, `SQLXML` or `STRUCT` data type and the JDBC driver does not support this data type
See Also:
  `Types`

#### 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