public final class JdbcUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
JdbcUtils.JdbcCallable<T> |
| Constructor and Description |
|---|
JdbcUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeQuietly(Connection connection)
Closes the specified
Connection, swallowing SQLExceptions. |
static void |
closeQuietly(ResultSet resultSet)
Closes the specified
ResultSet, swallowing SQLExceptions. |
static void |
closeQuietly(ResultSet resultSet,
Statement statement)
|
static void |
closeQuietly(Statement... statements)
Closes the specified
Statement, swallowing SQLExceptions. |
static Statement |
createStatement(ImportExportErrorService errorService,
String table,
Connection connection) |
static DatabaseMetaData |
metadata(ImportExportErrorService errorService,
Connection connection) |
static PreparedStatement |
preparedStatement(ImportExportErrorService errorService,
String table,
Connection connection,
String sql) |
static String |
quote(ImportExportErrorService errorService,
String table,
Connection connection,
String identifier)
Quotes the database identifier if needed.
|
static <T> T |
withConnection(ImportExportErrorService errorService,
ConnectionProvider provider,
JdbcUtils.JdbcCallable<T> callable) |
static <T> T |
withNoAutoCommit(ImportExportErrorService errorService,
Connection connection,
JdbcUtils.JdbcCallable<T> callable)
Executes callable with no autoCommit.
|
public static <T> T withConnection(ImportExportErrorService errorService, ConnectionProvider provider, JdbcUtils.JdbcCallable<T> callable)
public static <T> T withNoAutoCommit(ImportExportErrorService errorService, Connection connection, JdbcUtils.JdbcCallable<T> callable)
public static void closeQuietly(ResultSet resultSet)
ResultSet, swallowing SQLExceptions.resultSet - public static void closeQuietly(Statement... statements)
Statement, swallowing SQLExceptions.statements - the list of statements to closepublic static void closeQuietly(Connection connection)
Connection, swallowing SQLExceptions.connection - public static void closeQuietly(ResultSet resultSet, Statement statement)
resultSet - statement - public static String quote(ImportExportErrorService errorService, String table, Connection connection, String identifier)
errorService - table - connection - the current connection being usedidentifier - the database identifier to quote @return the quoted database identifiercom.atlassian.dbexporter.ImportExportException - if anything wrong happens getting information from the database connection.public static DatabaseMetaData metadata(ImportExportErrorService errorService, Connection connection)
public static Statement createStatement(ImportExportErrorService errorService, String table, Connection connection)
public static PreparedStatement preparedStatement(ImportExportErrorService errorService, String table, Connection connection, String sql)
Copyright © 2018 Atlassian. All rights reserved.