Uses of Class
org.jdbi.v3.core.Handle
Package
Description
The 'core' package hosts the top level interface into jdbi core.
The
extension
classes allow you to extend Jdbi
's
functionality by declaring interface types that may attach to Handle
instances.
The
spi
package includes entrypoints to extending Jdbi
instances with your own custom functionality.
The
statement
package provides most of the Fluent API
to drive statement execution.
The
transaction
package implements the strategy
Jdbi
uses to open and close transactions.
The
postgres
plugin provides improved support for
java.time
, hstore
, uuid
, and enum
types when configured with a recent Postgres database server.
Classes here provide integration hooks for working with the Spring framework.
Classes here provide integration hooks for working with the Spring framework.
SQL Objects
JUnit 4 testing support.
JUnit 5 testing support.
-
Uses of Handle in org.jdbi.v3.core
Modifier and TypeMethodDescriptionHandle.addHandleListener
(HandleListener handleListener) Add a specificHandleListener
which is called for specific events for this Handle.Handle.afterCommit
(Runnable afterCommit) Execute an action the next time this Handle commits, unless it is rolled back first.Handle.afterRollback
(Runnable afterRollback) Execute an action the next time this Handle rolls back, unless it is committed first.Handle.begin()
Start a transaction.Handle.commit()
Commit a transaction.Jdbi.open()
Obtain a Handle to the data source wrapped by this Jdbi instance.static Handle
Obtain a handle with just a JDBC URLstatic Handle
Obtain a handle with just a JDBC URLstatic Handle
Jdbi.open
(String url, Properties props) Obtain a handle with just a JDBC URLstatic Handle
Jdbi.open
(Connection connection) Create a Handle wrapping a particular JDBC Connectionstatic Handle
Jdbi.open
(DataSource dataSource) Convenience method used to obtain a handle from a specific data sourcestatic Handle
Jdbi.open
(ConnectionFactory connectionFactory) Convenience method used to obtain a handle from aConnectionFactory
.Deprecated.Handle.releaseSavepoint
(String savepointName) Release a previously created savepoint.Handle.removeHandleListener
(HandleListener handleListener) Remove aHandleListener
from this handle.Handle.rollback()
Rollback a transaction.Handle.rollbackToSavepoint
(String savepointName) Rollback a transaction to a named savepoint.Create a transaction savepoint with the name provided.Handle.setReadOnly
(boolean readOnly) Set the Handle read-only.Handle.setStatementBuilder
(StatementBuilder builder) Set the statement builder for this handle.Modifier and TypeMethodDescriptiondefault void
HandleListener.handleClosed
(Handle handle) A handle was closed.default void
HandleListener.handleCreated
(Handle handle) A handle was created.default void
Associate aHandle
with the current scope.void
Will be invoked with an open Handle.HandleCallback.withHandle
(Handle handle) Will be invoked with an open Handle. -
Uses of Handle in org.jdbi.v3.core.extension
-
Uses of Handle in org.jdbi.v3.core.spi
Modifier and TypeMethodDescriptiondefault Handle
JdbiPlugin.customizeHandle
(Handle handle) Configure customizations for a new Handle instance.Modifier and TypeMethodDescriptiondefault Handle
JdbiPlugin.customizeHandle
(Handle handle) Configure customizations for a new Handle instance. -
Uses of Handle in org.jdbi.v3.core.statement
ModifierConstructorDescriptionCall
(Handle handle, CharSequence sql) Backwards compatible constructor that takes an explicit string argument.MetaData
(Handle handle, MetaData.MetaDataValueProvider<?> metaDataFunction) PreparedBatch
(Handle handle, CharSequence sql) PreparedBatch
(Handle handle, String sql) Backwards compatible constructor that takes an explicit string argument.Query
(Handle handle, CharSequence sql) Backwards compatible constructor that takes an explicit string argument.Script
(Handle handle, CharSequence sql) Backwards compatible constructor that takes an explicit string argument.Update
(Handle handle, CharSequence sql) Backwards compatible constructor that takes an explicit string argument. -
Uses of Handle in org.jdbi.v3.core.transaction
Modifier and TypeMethodDescriptionvoid
Called when a transaction is startedvoid
void
void
Begin a transaction.void
Called when a transaction is committedvoid
void
void
void
Commit the transaction.<R,
X extends Exception>
RCMTTransactionHandler.inTransaction
(Handle handle, HandleCallback<R, X> callback) <R,
X extends Exception>
RCMTTransactionHandler.inTransaction
(Handle handle, TransactionIsolationLevel level, HandleCallback<R, X> callback) <R,
X extends Exception>
RDelegatingTransactionHandler.inTransaction
(Handle handle, HandleCallback<R, X> callback) <R,
X extends Exception>
RDelegatingTransactionHandler.inTransaction
(Handle handle, TransactionIsolationLevel level, HandleCallback<R, X> callback) <R,
X extends Exception>
RLocalTransactionHandler.inTransaction
(Handle handle, HandleCallback<R, X> callback) <R,
X extends Exception>
RLocalTransactionHandler.inTransaction
(Handle handle, TransactionIsolationLevel level, HandleCallback<R, X> callback) <R,
X extends Exception>
RSerializableTransactionRunner.inTransaction
(Handle handle, HandleCallback<R, X> callback) <R,
X extends Exception>
RSerializableTransactionRunner.inTransaction
(Handle handle, TransactionIsolationLevel level, HandleCallback<R, X> callback) <R,
X extends Exception>
RTransactionHandler.inTransaction
(Handle handle, HandleCallback<R, X> callback) Run a transaction.<R,
X extends Exception>
RTransactionHandler.inTransaction
(Handle handle, TransactionIsolationLevel level, HandleCallback<R, X> callback) Run a transaction.boolean
CMTTransactionHandler.isInTransaction
(Handle handle) Called to test if a handle is in a transactionboolean
DelegatingTransactionHandler.isInTransaction
(Handle handle) boolean
LocalTransactionHandler.isInTransaction
(Handle handle) boolean
TransactionHandler.isInTransaction
(Handle handle) Returns whether a given Handle is in the transaction.void
CMTTransactionHandler.releaseSavepoint
(Handle handle, String savepointName) Savepoints are not supported.void
DelegatingTransactionHandler.releaseSavepoint
(Handle handle, String name) void
LocalTransactionHandler.releaseSavepoint
(Handle handle, String savepointName) void
TransactionHandler.releaseSavepoint
(Handle handle, String savepointName) Release a previously created savepoint.void
void
Called when a transaction is rolled back Will throw a RuntimeException to force transactional rollbackvoid
void
void
Roll back the transaction.void
CMTTransactionHandler.rollbackToSavepoint
(Handle handle, String name) Savepoints are not supported.void
DelegatingTransactionHandler.rollbackToSavepoint
(Handle handle, String name) void
LocalTransactionHandler.rollbackToSavepoint
(Handle handle, String savepointName) void
TransactionHandler.rollbackToSavepoint
(Handle handle, String savepointName) Roll back to a named savepoint.void
Savepoints are not supported.void
void
void
Create a new savepoint.SerializableTransactionRunner.specialize
(Handle handle) default TransactionHandler
TransactionHandler.specialize
(Handle handle) Bind a TransactionHandler to a Handle, to allow it to track handle-local state. -
Uses of Handle in org.jdbi.v3.postgres
-
Uses of Handle in org.jdbi.v3.spring
Modifier and TypeMethodDescriptionstatic Handle
Obtain a Handle instance, either the transactionally bound one if we are in a transaction, or a new one otherwise.Modifier and TypeMethodDescriptionstatic void
JdbiUtil.closeIfNeeded
(Handle handle) Close a handle if it is not transactionally bound, otherwise no-op -
Uses of Handle in org.jdbi.v3.spring5
Modifier and TypeMethodDescriptionstatic Handle
Deprecated, for removal: This API element is subject to removal in a future version.Obtain a Handle instance, either the transactionally bound one if we are in a transaction, or a new one otherwise.Modifier and TypeMethodDescriptionstatic void
JdbiUtil.closeIfNeeded
(Handle handle) Deprecated, for removal: This API element is subject to removal in a future version.Close a handle if it is not transactionally bound, otherwise no-op -
Uses of Handle in org.jdbi.v3.sqlobject
-
Uses of Handle in org.jdbi.v3.testing
-
Uses of Handle in org.jdbi.v3.testing.junit5
Modifier and TypeMethodDescriptionfinal Handle
JdbiExtension.getSharedHandle()
Returns a sharedHandle
used by the extension.final Handle
JdbiExtension.openHandle()
Open a newHandle
to the used data source.Modifier and TypeMethodDescriptiondefault void
JdbiExtensionInitializer.cleanup
(DataSource ds, Handle handle) Run cleanup code after a test.void
JdbiFlywayMigration.cleanup
(DataSource ds, Handle handle) void
JdbiExtensionInitializer.initialize
(DataSource ds, Handle handle) Run initialization code before a test.void
JdbiFlywayMigration.initialize
(DataSource ds, Handle handle)
releaseSavepoint(String)