org.mariadb.jdbc
Class MariaDbFunctionStatement

java.lang.Object
  extended by org.mariadb.jdbc.MariaDbStatement
      extended by org.mariadb.jdbc.BasePrepareStatement
          extended by org.mariadb.jdbc.MariaDbPreparedStatementClient
              extended by org.mariadb.jdbc.CallableFunctionStatement
                  extended by org.mariadb.jdbc.MariaDbFunctionStatement
All Implemented Interfaces:
Cloneable, CallableStatement, PreparedStatement, Statement, Wrapper, CloneableCallableStatement

public class MariaDbFunctionStatement
extends CallableFunctionStatement
implements CloneableCallableStatement


Field Summary
 
Fields inherited from class org.mariadb.jdbc.CallableFunctionStatement
parameterMetadata, params
 
Fields inherited from class org.mariadb.jdbc.MariaDbPreparedStatementClient
parameterList, prepareResult
 
Fields inherited from class org.mariadb.jdbc.BasePrepareStatement
hasLongData, useFractionalSeconds
 
Fields inherited from class org.mariadb.jdbc.MariaDbStatement
batchQueries, canUseServerTimeout, closed, connection, fetchSize, lock, maxRows, mustCloseOnCompletion, options, protocol, queryTimeout, results, resultSetScrollType, timerTaskFuture, timerTaskRunnable, warningsCleared
 
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
MariaDbFunctionStatement(MariaDbConnection connection, String databaseName, String procedureName, String arguments)
          Specific implementation of CallableStatement to handle function call, represent by call like {?
 
Method Summary
 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()
           
protected  void setParameter(int parameterIndex, ParameterHolder holder)
           
 
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, nameToIndex, 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, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setURL, wasNull
 
Methods inherited from class org.mariadb.jdbc.MariaDbPreparedStatementClient
addBatch, addBatch, clearBatch, clearParameters, close, executeBatch, executeInternal, executeInternalBatch, executeLargeBatch, getMetaData, getParameterCount, getPrepareResult, toString
 
Methods inherited from class org.mariadb.jdbc.BasePrepareStatement
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, setInternalObject, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setNull, 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, execute, execute, execute, execute, executeBatchEpilogue, executeBatchExceptionEpilogue, executeEpilogue, executeExceptionEpilogue, executeInternal, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeQueryPrologue, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getProtocol, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getServerThreadId, getUpdateCount, getWarnings, handleFailoverAndTimeout, internalBatchExecution, isClosed, isCloseOnCompletion, isPoolable, isWrapperFor, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setLocalInfileInputStream, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, setTimerTask, skipMoreResults, stopTimeoutTask, testExecute, unloadDriver, 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, 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, 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, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setURL, wasNull
 
Methods inherited from interface java.sql.PreparedStatement
addBatch, clearParameters, 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, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL
 
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 

Constructor Detail

MariaDbFunctionStatement

public MariaDbFunctionStatement(MariaDbConnection connection,
                                String databaseName,
                                String procedureName,
                                String arguments)
                         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
procedureName - function name
arguments - function args
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 MariaDbPreparedStatementClient
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

protected void setParameter(int parameterIndex,
                            ParameterHolder holder)
                     throws SQLException
Overrides:
setParameter in class MariaDbPreparedStatementClient
Throws:
SQLException

executeQuery

public ResultSet executeQuery()
                       throws SQLException
Description copied from class: MariaDbPreparedStatementClient
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 MariaDbPreparedStatementClient
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: MariaDbPreparedStatementClient
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 MariaDbPreparedStatementClient
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()


Copyright © 2017. All rights reserved.