Package org.jdbi.v3.core.statement
Class Call
- java.lang.Object
-
- org.jdbi.v3.core.statement.BaseStatement<This>
-
- org.jdbi.v3.core.statement.SqlStatement<Call>
-
- org.jdbi.v3.core.statement.Call
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Configurable<Call>
public class Call extends SqlStatement<Call>
Used for invoking stored procedures.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classCall.OutParamArgument-
Nested classes/interfaces inherited from class org.jdbi.v3.core.statement.BaseStatement
BaseStatement.StatementCustomizerInvocation
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Call.OutParamArgument>params-
Fields inherited from class org.jdbi.v3.core.statement.SqlStatement
stmt
-
Fields inherited from class org.jdbi.v3.core.statement.BaseStatement
typedThis
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.sql.PreparedStatementcreateStatement(java.lang.String parsedSql)OutParametersinvoke()Invoke the callable statement.voidinvoke(java.util.function.Consumer<OutParameters> resultConsumer)Invoke the callable statement and process itsOutParametersresults.<T> Tinvoke(java.util.function.Function<OutParameters,T> resultComputer)Invoke the callable statement and process itsOutParametersresults, returning a computed value of typeT.CallregisterOutParameter(int position, int sqlType)Register a positional output parameter.CallregisterOutParameter(int position, int sqlType, CallableStatementMapper mapper)Register a positional output parameter.CallregisterOutParameter(java.lang.String name, int sqlType)Register a named output parameter.CallregisterOutParameter(java.lang.String name, int sqlType, CallableStatementMapper mapper)Register a named output parameter.-
Methods inherited from class org.jdbi.v3.core.statement.SqlStatement
afterExecution, beforeBinding, beforeExecution, beforeTemplating, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bind, bindArray, bindArray, bindArray, bindArray, bindArray, bindArray, bindArray, bindArray, bindASCIIStream, bindASCIIStream, bindBean, bindBean, bindBeanList, bindBinaryStream, bindBinaryStream, bindBySqlType, bindBySqlType, bindByType, bindByType, bindByType, bindByType, bindByType, bindByType, bindFields, bindFields, bindList, bindList, bindList, bindList, bindList, bindList, bindList, bindMap, bindMethods, bindMethods, bindMethodsList, bindNamedArgumentFinder, bindNamedArgumentFinder, bindNull, bindNull, bindNVarchar, bindNVarchar, bindPojo, bindPojo, bindPojo, bindPojo, bindPojo, bindPojo, cleanupHandleCommit, cleanupHandleRollback, cleanupStatement, defineList, defineList, defineNamedBindings, getBinding, getSql, internalExecute, mapperForType, mapperForType, mapperForType, parseSql, setQueryTimeout, toString
-
Methods inherited from class org.jdbi.v3.core.statement.BaseStatement
addCustomizers, attachToHandleForCleanup, callCustomizers, cleanUpForException, close, equals, getConfig, getContext, getHandle, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jdbi.v3.core.config.Configurable
addCustomizer, configure, define, getConfig, registerArgument, registerArgument, registerArrayType, registerArrayType, registerArrayType, registerArrayType, registerCodecFactory, registerCollector, registerCollector, registerColumnMapper, registerColumnMapper, registerColumnMapper, registerColumnMapper, registerColumnMapper, registerColumnMapper, registerExtension, registerRowMapper, registerRowMapper, registerRowMapper, registerRowMapper, setMapKeyColumn, setMapValueColumn, setSqlArrayArgumentStrategy, setSqlLogger, setSqlParser, setTemplateEngine, setTimingCollector
-
-
-
-
Field Detail
-
params
private final java.util.List<Call.OutParamArgument> params
-
-
Constructor Detail
-
Call
public Call(Handle handle, java.lang.CharSequence sql)
-
Call
public Call(Handle handle, java.lang.String sql)
Backwards compatible constructor that takes an explicit string argument.- See Also:
Call(Handle, CharSequence)
-
-
Method Detail
-
createStatement
java.sql.PreparedStatement createStatement(java.lang.String parsedSql) throws java.sql.SQLException- Overrides:
createStatementin classSqlStatement<Call>- Throws:
java.sql.SQLException
-
registerOutParameter
public Call registerOutParameter(int position, int sqlType)
Register a positional output parameter.- Parameters:
position- the parameter position (zero-based)sqlType- an SQL type constant as defined byTypesor by the JDBC vendor.- Returns:
- self
-
registerOutParameter
public Call registerOutParameter(int position, int sqlType, CallableStatementMapper mapper)
Register a positional output parameter.- Parameters:
position- the parameter position (zero-based)sqlType- an SQL type constant as defined byTypesor by the JDBC vendor.mapper- a mapper which converts theCallableStatementto a desired output type.- Returns:
- self
-
registerOutParameter
public Call registerOutParameter(java.lang.String name, int sqlType)
Register a named output parameter.- Parameters:
name- the parameter namesqlType- an SQL type constant as defined byTypesor by the JDBC vendor.- Returns:
- self
-
registerOutParameter
public Call registerOutParameter(java.lang.String name, int sqlType, CallableStatementMapper mapper)
Register a named output parameter.- Parameters:
name- the parameter namesqlType- an SQL type constant as defined byTypesor by the JDBC vendor.mapper- a mapper which converts theCallableStatementto a desired output type.- Returns:
- self
-
invoke
public OutParameters invoke()
Invoke the callable statement. Note that the statement will be cleaned up, so cursor-typed values may not work.- Returns:
- the output parameters resulting from the invocation.
-
invoke
public void invoke(java.util.function.Consumer<OutParameters> resultConsumer)
Invoke the callable statement and process itsOutParametersresults.
-
invoke
public <T> T invoke(java.util.function.Function<OutParameters,T> resultComputer)
Invoke the callable statement and process itsOutParametersresults, returning a computed value of typeT.
-
-