Package org.jdbi.v3.core.statement
Class Update
- java.lang.Object
-
- org.jdbi.v3.core.statement.BaseStatement<This>
-
- org.jdbi.v3.core.statement.SqlStatement<Update>
-
- org.jdbi.v3.core.statement.Update
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Configurable<Update>
public class Update extends SqlStatement<Update>
Used for INSERT, UPDATE, and DELETE statements
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jdbi.v3.core.statement.BaseStatement
BaseStatement.StatementCustomizerInvocation
-
-
Field Summary
-
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 intexecute()Executes the statement, returning the update count.<R> Rexecute(ResultProducer<R> producer)Executes the update, returning the result obtained from the givenResultProducer.ResultBearingexecuteAndReturnGeneratedKeys(java.lang.String... generatedKeyColumnNames)Execute the statement and returns any auto-generated keys.voidone()-
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, createStatement, 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
-
-
-
-
Constructor Detail
-
Update
public Update(Handle handle, java.lang.CharSequence sql)
-
Update
public Update(Handle handle, java.lang.String sql)
Backwards compatible constructor that takes an explicit string argument.- See Also:
Update(Handle, CharSequence)
-
-
Method Detail
-
one
public void one()
-
execute
public int execute()
Executes the statement, returning the update count.- Returns:
- the number of rows modified
-
execute
public <R> R execute(ResultProducer<R> producer)
Executes the update, returning the result obtained from the givenResultProducer.- Type Parameters:
R- the result type- Parameters:
producer- the result producer.- Returns:
- value returned by the result producer.
-
executeAndReturnGeneratedKeys
public ResultBearing executeAndReturnGeneratedKeys(java.lang.String... generatedKeyColumnNames)
Execute the statement and returns any auto-generated keys. This requires the JDBC driver to support theStatement.getGeneratedKeys()method.- Parameters:
generatedKeyColumnNames- optional list of generated key column names.- Returns:
- ResultBearing of generated keys
-
-