public class MariaDbFunctionStatement extends CallableFunctionStatement implements CloneableCallableStatement
Modifier and Type | Field and Description |
---|---|
private SelectResultSet |
outputResultSet |
parameterMetadata
autoGeneratedKeys, hasLongData, SPEC_ISO_ZONED_DATE_TIME
canUseServerTimeout, closed, connection, executing, fetchSize, lock, maxRows, options, protocol, queryTimeout, results, resultSetConcurrency, resultSetScrollType
Constructor and Description |
---|
MariaDbFunctionStatement(MariaDbConnection connection,
java.lang.String databaseName,
java.lang.String procedureName,
java.lang.String arguments,
int resultSetType,
int resultSetConcurrency)
Specific implementation of CallableStatement to handle function call, represent by call like
{?= call procedure-name[(arg1,arg2, ...)]}.
|
Modifier and Type | Method and Description |
---|---|
MariaDbFunctionStatement |
clone(MariaDbConnection connection)
Clone statement.
|
boolean |
execute()
Executes the SQL statement in this
PreparedStatement object, which may be any kind
of SQL statement. |
java.sql.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() |
private void |
retrieveOutputResult() |
void |
setParameter(int parameterIndex,
ParameterHolder holder)
Set parameter.
|
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
addBatch, addBatch, clearBatch, clearParameters, close, executeBatch, executeInternal, executeLargeBatch, getMetaData, getParameterCount, getPrepareResult, getServerUpdateCounts, toString
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
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, unwrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
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
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
addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, 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, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
private SelectResultSet outputResultSet
public MariaDbFunctionStatement(MariaDbConnection connection, java.lang.String databaseName, java.lang.String procedureName, java.lang.String arguments, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
connection
- current connectiondatabaseName
- database nameprocedureName
- function namearguments
- function argsresultSetType
- 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
java.sql.SQLException
- exceptionprotected SelectResultSet getResult() throws java.sql.SQLException
getResult
in class CallableFunctionStatement
java.sql.SQLException
public MariaDbFunctionStatement clone(MariaDbConnection connection) throws java.lang.CloneNotSupportedException
clone
in interface CloneableCallableStatement
clone
in class CallableFunctionStatement
connection
- connectionjava.lang.CloneNotSupportedException
- if any error occur.public int executeUpdate() throws java.sql.SQLException
executeUpdate
in interface java.sql.PreparedStatement
executeUpdate
in class ClientSidePreparedStatement
java.sql.SQLException
- if a database access error occurs; this method is called on a closed
PreparedStatement
or the SQL statement returns a
ResultSet
objectprivate void retrieveOutputResult() throws java.sql.SQLException
java.sql.SQLException
public void setParameter(int parameterIndex, ParameterHolder holder) throws java.sql.SQLException
ClientSidePreparedStatement
setParameter
in class ClientSidePreparedStatement
parameterIndex
- indexholder
- parameter holderjava.sql.SQLException
- if index position doesn't correspond to query parameterspublic java.sql.ResultSet executeQuery() throws java.sql.SQLException
ClientSidePreparedStatement
PreparedStatement
object and returns the
ResultSet
object generated by the query.executeQuery
in interface java.sql.PreparedStatement
executeQuery
in class ClientSidePreparedStatement
ResultSet
object that contains the data produced by the query; never
null
java.sql.SQLException
- if a database access error occurs; this method is called on a closed
PreparedStatement
or the SQL statement does not return a
ResultSet
objectpublic boolean execute() throws java.sql.SQLException
ClientSidePreparedStatement
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
.
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).execute
in interface java.sql.PreparedStatement
execute
in class ClientSidePreparedStatement
true
if the first result is a ResultSet
object; false
if the first result is an update count or there is no resultjava.sql.SQLException
- if a database access error occurs; this method is called on a closed
PreparedStatement
or an argument is supplied to this methodStatement.execute(java.lang.String)
,
Statement.getResultSet()
,
Statement.getUpdateCount()
,
Statement.getMoreResults()