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
parameterMetadataFields inherited from class org.mariadb.jdbc.BasePrepareStatement
autoGeneratedKeys, hasLongData, SPEC_ISO_ZONED_DATE_TIMEFields inherited from class org.mariadb.jdbc.MariaDbStatement
canUseServerTimeout, closed, connection, executing, fetchSize, lock, maxRows, options, protocol, queryTimeout, results, resultSetConcurrency, resultSetScrollTypeFields 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) 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.booleanexecute()Executes the SQL statement in thisPreparedStatementobject, which may be any kind of SQL statement.Executes the SQL query in thisPreparedStatementobject and returns theResultSetobject generated by the query.intExecutes the CALL statement.protected SelectResultSetprivate voidvoidsetParameter(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, wasNullMethods inherited from class org.mariadb.jdbc.ClientSidePreparedStatement
addBatch, addBatch, clearBatch, clearParameters, close, executeBatch, executeInternal, executeLargeBatch, getMetaData, getParameterCount, getPrepareResult, getServerUpdateCounts, toStringMethods 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, setURLMethods inherited from class org.mariadb.jdbc.MariaDbStatement
cancel, checkClose, checkCloseOnCompletion, clearWarnings, closeOnCompletion, 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, getServerThreadId, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isWrapperFor, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setLocalInfileInputStream, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, setTimerTask, skipMoreResults, testExecute, unwrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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, wasNullMethods 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, setURLMethods 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, setQueryTimeoutMethods 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) 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_SENSITIVEresultSetConcurrency- a concurrency type; one ofResultSet.CONCUR_READ_ONLYorResultSet.CONCUR_UPDATABLE- Throws:
SQLException- exception
-
-
Method Details
-
getResult
- Specified by:
getResultin classCallableFunctionStatement- Throws:
SQLException
-
clone
public MariaDbFunctionStatement clone(MariaDbConnection connection) throws CloneNotSupportedException Clone statement.- Specified by:
clonein interfaceCloneableCallableStatement- Overrides:
clonein classCallableFunctionStatement- Parameters:
connection- connection- Returns:
- Clone statement.
- Throws:
CloneNotSupportedException- if any error occur.
-
executeUpdate
Executes the CALL statement.- Specified by:
executeUpdatein interfacePreparedStatement- Overrides:
executeUpdatein 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 closedPreparedStatementor the SQL statement returns aResultSetobject
-
retrieveOutputResult
- Throws:
SQLException
-
setParameter
Description copied from class:ClientSidePreparedStatementSet parameter.- Overrides:
setParameterin classClientSidePreparedStatement- Parameters:
parameterIndex- indexholder- parameter holder- Throws:
SQLException- if index position doesn't correspond to query parameters
-
executeQuery
Description copied from class:ClientSidePreparedStatementExecutes the SQL query in thisPreparedStatementobject and returns theResultSetobject generated by the query.- Specified by:
executeQueryin interfacePreparedStatement- Overrides:
executeQueryin classClientSidePreparedStatement- Returns:
- a
ResultSetobject that contains the data produced by the query; nevernull - Throws:
SQLException- if a database access error occurs; this method is called on a closedPreparedStatementor the SQL statement does not return aResultSetobject
-
execute
Description copied from class:ClientSidePreparedStatementExecutes the SQL statement in thisPreparedStatementobject, which may be any kind of SQL statement. Some prepared statements return multiple results; theexecutemethod handles these complex statements as well as the simpler form of statements handled by the methodsexecuteQueryandexecuteUpdate.
Theexecutemethod returns abooleanto indicate the form of the first result. You must call either the methodgetResultSetorgetUpdateCountto retrieve the result; you must callgetInternalMoreResultsto move to any subsequent result(s).- Specified by:
executein interfacePreparedStatement- Overrides:
executein classClientSidePreparedStatement- Returns:
trueif the first result is aResultSetobject;falseif 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 closedPreparedStatementor an argument is supplied to this method- See Also:
-