Package org.mariadb.jdbc

## Class MariaDbFunctionStatement

- java.lang.Object
- - org.mariadb.jdbc.MariaDbStatement
  - - org.mariadb.jdbc.BasePrepareStatement
    - - org.mariadb.jdbc.ClientSidePreparedStatement
      - - org.mariadb.jdbc.CallableFunctionStatement
        - - org.mariadb.jdbc.MariaDbFunctionStatement

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

    public class MariaDbFunctionStatement
    extends CallableFunctionStatement
    implements CloneableCallableStatement

### Field Summary

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

`parameterMetadata`

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

`autoGeneratedKeys, SPEC_ISO_ZONED_DATE_TIME`

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

`canUseServerTimeout, closed, connection, exceptionFactory, executing, fetchSize, lock, maxRows, options, protocol, queryTimeout, results, resultSetConcurrency, resultSetScrollType`

### 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
`MariaDbFunctionStatement​(MariaDbConnection connection, String databaseName, String functionName, String arguments, int resultSetType, int resultSetConcurrency, ExceptionFactory exceptionFactory)` Specific implementation of CallableStatement to handle function call, represent by call like {?= call procedure-name[(arg1,arg2, ...)]}.

### Method Summary

All Methods Instance Methods Concrete Methods
`MariaDbFunctionStatement` `clone​(MariaDbConnection connection)` Clone statement.
`boolean` `execute()` Executes the SQL statement in this `PreparedStatement` object, which may be any kind of SQL statement.
`ResultSet` `executeQuery()` Executes the SQL query in this `PreparedStatement` object and returns the `ResultSet` object generated by the query.
`int` `executeUpdate()` Executes the CALL statement.
`protected SelectResultSet` `getResult()`
`void` `setParameter​(int parameterIndex, ParameterHolder holder)` Set parameter.

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

`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, initFunctionData, registerOutParameter, 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.ClientSidePreparedStatement

`addBatch, addBatch, clearBatch, clearParameters, close, executeBatch, executeInternal, executeLargeBatch, getMetaData, getParameterCount, getPrepareResult, getServerUpdateCounts, toString`

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

`executeLargeUpdate, 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, setNull, setObject, setObject, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL`

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

`cancel, checkClose, checkCloseOnCompletion, clearWarnings, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeBatchEpilogue, executeBatchExceptionEpilogue, executeEpilogue, executeExceptionEpilogue, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeQueryPrologue, 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, isWrapperFor, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setLocalInfileInputStream, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, setTimerTask, skipMoreResults, testExecute, unwrap`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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, 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, executeLargeUpdate, 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

#### MariaDbFunctionStatement

    public MariaDbFunctionStatement​(MariaDbConnection connection,
                                    String databaseName,
                                    String functionName,
                                    String arguments,
                                    int resultSetType,
                                    int resultSetConcurrency,
                                    ExceptionFactory exceptionFactory)
                             throws SQLException

Specific implementation of CallableStatement to handle function call, represent by call like {?= call procedure-name[(arg1,arg2, ...)]}.

Parameters:
  `connection` - current connection
  `databaseName` - database name
  `functionName` - function name
  `arguments` - function args
  `resultSetType` - a result set type; one of `ResultSet.TYPE_FORWARD_ONLY`, `ResultSet.TYPE_SCROLL_INSENSITIVE`, or `ResultSet.TYPE_SCROLL_SENSITIVE`
  `resultSetConcurrency` - a concurrency type; one of `ResultSet.CONCUR_READ_ONLY` or `ResultSet.CONCUR_UPDATABLE`
  `exceptionFactory` - Exception factory
Throws:
  `SQLException` - exception

### Method Detail

#### getResult

    protected SelectResultSet getResult()
                                 throws SQLException

Specified by:
  `getResult` in class `CallableFunctionStatement`
Throws:
  `SQLException`

#### clone

    public MariaDbFunctionStatement clone​(MariaDbConnection connection)
                                   throws CloneNotSupportedException

Clone statement.

Specified by:
  `clone` in interface `CloneableCallableStatement`
Overrides:
  `clone` in class `CallableFunctionStatement`
Parameters:
  `connection` - connection
Returns:
  Clone statement.
Throws:
  `CloneNotSupportedException` - if any error occur.

#### executeUpdate

    public int executeUpdate()
                      throws SQLException

Executes the CALL statement.

Specified by:
  `executeUpdate` in interface `PreparedStatement`
Overrides:
  `executeUpdate` in class `ClientSidePreparedStatement`
Returns:
  either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing
Throws:
  `SQLException` - if a database access error occurs; this method is called on a closed `PreparedStatement` or the SQL statement returns a `ResultSet` object

#### setParameter

    public void setParameter​(int parameterIndex,
                             ParameterHolder holder)
                      throws SQLException

Description copied from class: `ClientSidePreparedStatement`
Set parameter.

Overrides:
  `setParameter` in class `ClientSidePreparedStatement`
Parameters:
  `parameterIndex` - index
  `holder` - parameter holder
Throws:
  `SQLException` - if index position doesn't correspond to query parameters

#### executeQuery

    public ResultSet executeQuery()
                           throws SQLException

Description copied from class: `ClientSidePreparedStatement`
Executes the SQL query in this `PreparedStatement` object and returns the `ResultSet` object generated by the query.

Specified by:
  `executeQuery` in interface `PreparedStatement`
Overrides:
  `executeQuery` in class `ClientSidePreparedStatement`
Returns:
  a `ResultSet` object that contains the data produced by the query; never `null`
Throws:
  `SQLException` - if a database access error occurs; this method is called on a closed `PreparedStatement` or the SQL statement does not return a `ResultSet` object

#### execute

    public boolean execute()
                    throws SQLException

Description copied from class: `ClientSidePreparedStatement`
Executes the SQL statement in this `PreparedStatement` object, which may be any kind of SQL statement. Some prepared statements return multiple results; the `execute` method handles these complex statements as well as the simpler form of statements handled by the methods `executeQuery` and `executeUpdate`.
The `execute` method returns a `boolean` to indicate the form of the first result. You must call either the method `getResultSet` or `getUpdateCount` to retrieve the result; you must call `getInternalMoreResults` to move to any subsequent result(s).

Specified by:
  `execute` in interface `PreparedStatement`
Overrides:
  `execute` in class `ClientSidePreparedStatement`
Returns:
  `true` if the first result is a `ResultSet` object; `false` if the first result is an update count or there is no result
Throws:
  `SQLException` - if a database access error occurs; this method is called on a closed `PreparedStatement` or an argument is supplied to this method
See Also:
  `Statement.execute(java.lang.String)`, `Statement.getResultSet()`, `Statement.getUpdateCount()`, `Statement.getMoreResults()`