public interface ConnectionProvider
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the connection provider and releases its resources.
|
static ConnectionProvider |
from(Connection connection)
Warning: Don't pass one of these as a ConnectionProvider to a pool because
once the pool closes the connection the pool cannot create a new one (the
same closed connection is returned).
|
static ConnectionProvider |
from(String url) |
static ConnectionProvider |
from(String url,
Properties properties) |
static ConnectionProvider |
from(String url,
String username,
String password) |
Connection |
get()
Returns a new
Connection (perhaps from a Connection pool). |
@Nonnull Connection get()
Connection
(perhaps from a Connection pool).void close()
static ConnectionProvider from(@Nonnull Connection connection)
connection
- connection for singleton providerstatic ConnectionProvider from(@Nonnull String url)
static ConnectionProvider from(@Nonnull String url, String username, String password)
static ConnectionProvider from(@Nonnull String url, Properties properties)
Copyright © 2022–2023. All rights reserved.