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
FieldsFields 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
ConstructorsConstructorDescriptionMariaDbFunctionStatement
(MariaDbConnection connection, String databaseName, String procedureName, 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
Modifier and TypeMethodDescriptionclone
(MariaDbConnection connection) Clone statement.boolean
execute()
Executes the SQL statement in thisPreparedStatement
object, which may be any kind of SQL statement.Executes the SQL query in thisPreparedStatement
object and returns theResultSet
object generated by the query.int
Executes the CALL statement.protected SelectResultSet
private void
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
-
Field Details
-
outputResultSet
-
-
Constructor Details
-
MariaDbFunctionStatement
public MariaDbFunctionStatement(MariaDbConnection connection, String databaseName, String procedureName, 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 connectiondatabaseName
- database nameprocedureName
- function namearguments
- function argsresultSetType
- a result set type; one ofResultSet.TYPE_FORWARD_ONLY
,ResultSet.TYPE_SCROLL_INSENSITIVE
, orResultSet.TYPE_SCROLL_SENSITIVE
resultSetConcurrency
- a concurrency type; one ofResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_UPDATABLE
exceptionFactory
- Exception factory- Throws:
SQLException
- exception
-
-
Method Details
-
getResult
- Specified by:
getResult
in classCallableFunctionStatement
- Throws:
SQLException
-
clone
public MariaDbFunctionStatement clone(MariaDbConnection connection) throws CloneNotSupportedException Clone statement.- Specified by:
clone
in interfaceCloneableCallableStatement
- Overrides:
clone
in classCallableFunctionStatement
- Parameters:
connection
- connection- Returns:
- Clone statement.
- Throws:
CloneNotSupportedException
- if any error occur.
-
executeUpdate
Executes the CALL statement.- Specified by:
executeUpdate
in interfacePreparedStatement
- Overrides:
executeUpdate
in classClientSidePreparedStatement
- 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 closedPreparedStatement
or the SQL statement returns aResultSet
object
-
retrieveOutputResult
- Throws:
SQLException
-
setParameter
Description copied from class:ClientSidePreparedStatement
Set parameter.- Overrides:
setParameter
in classClientSidePreparedStatement
- Parameters:
parameterIndex
- indexholder
- parameter holder- Throws:
SQLException
- if index position doesn't correspond to query parameters
-
executeQuery
Description copied from class:ClientSidePreparedStatement
Executes the SQL query in thisPreparedStatement
object and returns theResultSet
object generated by the query.- Specified by:
executeQuery
in interfacePreparedStatement
- Overrides:
executeQuery
in classClientSidePreparedStatement
- Returns:
- a
ResultSet
object that contains the data produced by the query; nevernull
- Throws:
SQLException
- if a database access error occurs; this method is called on a closedPreparedStatement
or the SQL statement does not return aResultSet
object
-
execute
Description copied from class:ClientSidePreparedStatement
Executes the SQL statement in thisPreparedStatement
object, which may be any kind of SQL statement. Some prepared statements return multiple results; theexecute
method handles these complex statements as well as the simpler form of statements handled by the methodsexecuteQuery
andexecuteUpdate
.
Theexecute
method returns aboolean
to indicate the form of the first result. You must call either the methodgetResultSet
orgetUpdateCount
to retrieve the result; you must callgetInternalMoreResults
to move to any subsequent result(s).- Specified by:
execute
in interfacePreparedStatement
- Overrides:
execute
in classClientSidePreparedStatement
- Returns:
true
if the first result is aResultSet
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 closedPreparedStatement
or an argument is supplied to this method- See Also:
-