java.lang.Object
net.anwiba.commons.jdbc.DatabaseUtilities
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidadd(PreparedStatement statement, Object... values) static voidadd(PreparedStatement statement, IProcedure<PreparedStatement, SQLException> prepareProcedure) static ObjectadjustValue(Object value) static <T> Taggregate(Connection connection, String statementString, IConverter<Iterable<IResult>, T, SQLException> function) static <T> Taggregate(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<Iterable<IResult>, T, SQLException> resultProcedure) static <T> Taggregate(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IConverter<Iterable<IResult>, T, SQLException> function) static <T> Taggregate(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<Iterable<IResult>, T, SQLException> resultProcedure) static <T> Taggregate(ICanceler canceler, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<Iterable<IResult>, T, SQLException> resultProcedure) static SQLExceptionasSQLException(Throwable throwable) static IBatchTransferbatchTransfer(Connection connection, String tableName, String[] identifierNames, String[] valueNames) static IBatchTransferbatchTransfer(Connection connection, String selectExistsStatement, String insertStatement, String updateStatement) static booleanbooleanResult(Connection connection, String statementString, Object... values) static booleanbooleanResult(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) static booleanbooleanResult(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) static final booleancall(Connection connection, String statementString, Object... values) static final booleancall(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> procedure) static booleancall(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IProcedure<ResultSet, SQLException> resultProcedure) static SQLExceptionclose(AutoCloseable closeable) static SQLExceptionclose(AutoCloseable closeable, AutoCloseable other, AutoCloseable... others) static SQLExceptionclose(SQLException exception, AutoCloseable closeable) static SQLExceptionclose(SQLException exception, AutoCloseable closeable, AutoCloseable other, AutoCloseable... others) static voidstatic voidcommit(Connection connection, IntCounter executeCounter, SQLException exception) static booleancontains(Connection connection, String statementString, String columnName, Object value) static intcount(Connection connection, String statementString, Object... values) static intcount(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) static intcount(PreparedStatement statement, IProcedure<PreparedStatement, SQLException> prepareProcedure) static intcount(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, Object... values) static booleancreate(Connection connection, String statementString) static StringcreateIdentifierSelectStatement(String tableName, String identifierColumnName, Iterable<String> valueColumnNames) static StringcreateIdentifierSelectStatement(String tableName, String identifierColumnName, String orderByColumnName, Iterable<String> valueColumnNames) static voidcreateIfNotExists(Connection connection, String schemaName, String tableName, String createStatementString) static StringcreateSelectStatement(String tableName, Iterable<String> columnNames, Iterable<String> valueColumnNames) static StringcreateSelectStatement(String tableName, Iterable<String> conditionColumnNames, String orderByColumnName, Iterable<String> resultColumnNames) static PreparedStatementcreateStatement(Connection connection, String statementString) static DoubledoubleResult(Connection connection, String statementString, Object... values) static DoubledoubleResult(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) static voiddropIndex(Connection connection, String schemaName, String indexName) static voiddropTable(Connection connection, String schemaName, String tableName) static voidexecute(Connection connection, File file) static voidexecute(Connection connection, File file, String commandEnd) static booleanexecute(Connection connection, String statementString) static final booleanexecute(Connection connection, String statementString, Object... values) static final booleanexecute(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> procedure) static booleanexecute(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IProcedure<ResultSet, SQLException> resultProcedure) static booleanstatic <T> Texecute(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, IFunction<Connection, T, SQLException> function) static <T> Texecute(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, IInterruptableFunction<Connection, T, SQLException> function) static voidexecute(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, IProcedure<Connection, SQLException> procedure) static <T> Texecute(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IInterruptableProcedure<PreparedStatement, SQLException> prepareProcedure, IInterruptableBiFunction<PreparedStatement, IBooleanContainer, T, SQLException> function) static <T> Texecute(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IBiFunction<PreparedStatement, IBooleanContainer, T, SQLException> function) static <T> Texecute(ICanceler canceler, Connection connection, String statementString, IBiFunction<PreparedStatement, IBooleanContainer, T, SQLException> function) static <T> Texecute(ICanceler canceler, Connection connection, String statementString, IInterruptableBiFunction<PreparedStatement, IBooleanContainer, T, SQLException> function) static <T> Texecute(ICanceler canceler, Connection connection, String statementString, IInterruptableProcedure<PreparedStatement, SQLException> prepareProcedure, IInterruptableBiFunction<PreparedStatement, IBooleanContainer, T, SQLException> function) static <T> Texecute(ICanceler canceler, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IBiFunction<PreparedStatement, IBooleanContainer, T, SQLException> function) static intexecuteBatch(IntCounter insertCounter, IntCounter executeCounter, PreparedStatement statement) static booleanexists(Connection connection, String schemaName, String tableName) static booleanexists(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription) static voidforeach(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConsumer<IResult, SQLException> resultConsumer) static StringgetAsString(Statement statement, String statementString) static ConstraintgetConstraint(Map<String, Constraint> constraints, String constraintName, ConstraintType constraintType, String condition) static Doublestatic IntegergetInteger(ResultSet resultSet, int index) static Longstatic intgetMajorVersion(Connection connection) static intgetMinorVersion(Connection connection) static StringgetOwner(Connection connection, String owner) static StringgetProduct(Connection connection) static StringgetStatementString(Connection connection, double beforVersion, String statement, String defaultStatement) static String[]getTableTypes(DatabaseMetaData metaData, IApplicable<String> applicableType) static StringgetVersion(Connection connection) static doublegetVersionAsDouble(Connection connection) interruptableStetter(Object... objects) interruptableStetter(List objects) static booleanisSupported(String url) static IClosableIterator<IResult,SQLException> iterator(ICanceler canceler, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) static <T> IClosableIterator<T,SQLException> iterator(ICanceler canceler, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IResult, T, SQLException> resultConverter) static IClosableIterator<IResult,SQLException> iterator(ICanceler canceler, PreparedStatement statement) static <T> IClosableIterator<T,SQLException> iterator(ICanceler canceler, PreparedStatement statement, IConverter<IResult, T, SQLException> resultConverter) static <T> IClosableIterator<T,SQLException> iterator(ICanceler canceler, ResultSet resultSet, IConverter<IResult, T, SQLException> resultConverter) static LonglongResult(Connection connection, String statementString, Object... values) static LonglongResult(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) static LonglongResult(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IOptional<IResult, SQLException>, Long, SQLException> resultFunction) static LonglongResult(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) static <T> List<T>metadatas(ICanceler canceler, Connection connection, IFactory<DatabaseMetaData, ResultSet, SQLException> resultSetFactory, IConverter<ResultSet, T, SQLException> resultConverter) static Longnext(Connection connection, String statementString) static voidstatic <T> IClosableIterator<T,SQLException> query(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IResult, T, SQLException> converter) static Map<String,Constraint> readConstraints(Connection connection, String statementString, String schemaName, String tableName) static <T> Tresult(Connection connection, String statementString, IConverter<IOptional<IResult, SQLException>, T, SQLException> converter) static <T> Tresult(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IOptional<IResult, SQLException>, T, SQLException> resultConverter) static <T> Tresult(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IConverter<IOptional<IResult, SQLException>, T, SQLException> resultConverter) static <T> Tresult(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IOptional<IResult, SQLException>, T, SQLException> resultFunction) static <T> Tresult(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IOptional<IResult, SQLException>, T, SQLException> resultFunction) static <T> Tresult(ICanceler canceler, Connection connection, String statementString, IConverter<IOptional<IResult, SQLException>, T, SQLException> converter) static <T> Tresult(ICanceler canceler, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IOptional<IResult, SQLException>, T, SQLException> resultFunction) static <T> List<T>results(Connection connection, String statementString, IConverter<IResult, T, SQLException> function) static <T> List<T>results(Connection connection, String statementString, IInterruptableFunction<IResult, T, SQLException> resultFunction) static <T> List<T>results(Connection connection, String statementString, IInterruptableProcedure<PreparedStatement, SQLException> prepareClosure, IInterruptableFunction<IResult, T, SQLException> resultFunction) static <T> List<T>results(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IResult, T, SQLException> resultProcedure) static <T> List<T>results(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IConverter<IResult, T, SQLException> function) static <T> List<T>results(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IInterruptableFunction<IResult, T, SQLException> resultFunction) static <T> List<T>results(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IResult, T, SQLException> function) static <T> List<T>results(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IConverter<IResult, T, SQLException> resultConverter) static <T> List<T>results(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IInterruptableProcedure<PreparedStatement, SQLException> prepareProcedure, IInterruptableFunction<IResult, T, SQLException> resultProcedure) static <T> List<T>results(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IResult, T, SQLException> resultConverter) static <T> List<T>results(ICanceler canceler, Connection connection, String statementString, IConverter<IResult, T, SQLException> resultConverter) static <T> List<T>results(ICanceler canceler, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IResult, T, SQLException> resultConverter) static ResultSetresultSet(Connection connection, String string) static ResultSetresultSet(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) static ResultSetresultSet(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) static ResultSetresultSet(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IBiFunction<PreparedStatement, IBooleanContainer, ResultSet, SQLException> function) static ResultSetresultSet(ICanceler canceler, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) static SQLExceptionrollback(Connection connection, IntCounter executeCounter, SQLException exception) static IProcedure<PreparedStatement,SQLException> static IProcedure<PreparedStatement,SQLException> static voidsetValueToStatement(Connection connection, PreparedStatement statement, int i, IDatabaseValue value) static Runnablesilent(IBlock<SQLException> block) static Runnablesilent(IBlock<SQLException> block, Supplier<String> loggerMessage) static StringstringResult(Connection connection, String statementString, Object... values) static StringstringResult(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) static StringstringResult(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IOptional<IResult, SQLException>, String, SQLException> resultFunction) static StringstringResult(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) static voidthrowIfNotEmpty(List<Throwable> throwables) static voidthrowIfNotNull(Throwable throwable) static Stringstatic int[]transfer(PreparedStatement statement) update(Connection connection, String statementString, Object... values) update(Connection connection, String statementString, String[] returnColumns, Object... values) update(Connection connection, String statementString, String[] returnColumns, IProcedure<PreparedStatement, SQLException> prepareProcedure) update(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) update(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String updatetStatement, String[] returnColumns, IProcedure<PreparedStatement, SQLException> prepareProcedure) update(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String updatetStatement, IProcedure<PreparedStatement, SQLException> prepareProcedure) static <I> ICloseableConsumer<I,Boolean, SQLException> update(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IAggregator<PreparedStatement, I, Boolean, SQLException> aggregator) static <I> ICloseableConsumer<I,Boolean, SQLException> update(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IConverter<I, List<IDatabaseValue>, SQLException> converter) static IVersionversion(Connection connection) static WrappedResultSetwrapWithUnclosableStatement(ResultSet resultSet)
-
Constructor Details
-
DatabaseUtilities
public DatabaseUtilities()
-
-
Method Details
-
close
-
close
public static SQLException close(SQLException exception, AutoCloseable closeable, AutoCloseable other, AutoCloseable... others) -
close
public static SQLException close(AutoCloseable closeable, AutoCloseable other, AutoCloseable... others) -
close
-
wrapWithUnclosableStatement
- Throws:
SQLException
-
throwIfNotNull
- Throws:
SQLException
-
throwIfNotEmpty
- Throws:
SQLException
-
asSQLException
-
execute
public static void execute(Connection connection, File file) throws FileNotFoundException, IOException, SQLException -
execute
public static void execute(Connection connection, File file, String commandEnd) throws FileNotFoundException, IOException, SQLException -
execute
- Throws:
SQLException
-
execute
public static final boolean execute(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> procedure) throws SQLException- Throws:
SQLException
-
execute
public static final boolean execute(Connection connection, String statementString, Object... values) throws SQLException - Throws:
SQLException
-
execute
public static boolean execute(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IProcedure<ResultSet, throws SQLExceptionSQLException> resultProcedure) - Throws:
SQLException
-
execute
public static <T> T execute(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, IFunction<Connection, T, throws SQLExceptionSQLException> function) - Throws:
SQLException
-
execute
public static <T> T execute(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, IInterruptableFunction<Connection, T, throws SQLException, CanceledExceptionSQLException> function) - Throws:
SQLExceptionCanceledException
-
execute
public static void execute(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, IProcedure<Connection, SQLException> procedure) throws SQLException- Throws:
SQLException
-
execute
public static <T> T execute(ICanceler canceler, Connection connection, String statementString, IBiFunction<PreparedStatement, IBooleanContainer, throws SQLExceptionT, SQLException> function) - Throws:
SQLException
-
execute
public static <T> T execute(ICanceler canceler, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IBiFunction<PreparedStatement, throws SQLExceptionIBooleanContainer, T, SQLException> function) - Throws:
SQLException
-
execute
public static <T> T execute(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IBiFunction<PreparedStatement, throws SQLExceptionIBooleanContainer, T, SQLException> function) - Throws:
SQLException
-
execute
public static <T> T execute(ICanceler canceler, Connection connection, String statementString, IInterruptableBiFunction<PreparedStatement, IBooleanContainer, throws SQLException, CanceledExceptionT, SQLException> function) - Throws:
SQLExceptionCanceledException
-
execute
public static <T> T execute(ICanceler canceler, Connection connection, String statementString, IInterruptableProcedure<PreparedStatement, SQLException> prepareProcedure, IInterruptableBiFunction<PreparedStatement, throws SQLException, CanceledExceptionIBooleanContainer, T, SQLException> function) - Throws:
SQLExceptionCanceledException
-
execute
public static <T> T execute(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IInterruptableProcedure<PreparedStatement, SQLException> prepareProcedure, IInterruptableBiFunction<PreparedStatement, throws SQLException, CanceledExceptionIBooleanContainer, T, SQLException> function) - Throws:
SQLExceptionCanceledException
-
getStatementString
public static String getStatementString(Connection connection, double beforVersion, String statement, String defaultStatement) throws SQLException - Throws:
SQLException
-
getVersionAsDouble
- Throws:
SQLException
-
getProduct
- Throws:
SQLException
-
getVersion
- Throws:
SQLException
-
getMajorVersion
- Throws:
SQLException
-
getMinorVersion
- Throws:
SQLException
-
readConstraints
public static Map<String,Constraint> readConstraints(Connection connection, String statementString, String schemaName, String tableName) throws SQLException - Throws:
SQLException
-
getConstraint
public static Constraint getConstraint(Map<String, Constraint> constraints, String constraintName, ConstraintType constraintType, String condition) -
dropTable
public static void dropTable(Connection connection, String schemaName, String tableName) throws SQLException - Throws:
SQLException
-
dropIndex
public static void dropIndex(Connection connection, String schemaName, String indexName) throws SQLException - Throws:
SQLException
-
getOwner
- Throws:
SQLException
-
resultSet
- Throws:
SQLException
-
resultSet
public static ResultSet resultSet(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
resultSet
public static ResultSet resultSet(ICanceler canceler, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
resultSet
public static ResultSet resultSet(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
resultSet
public static ResultSet resultSet(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IBiFunction<PreparedStatement, throws SQLExceptionIBooleanContainer, ResultSet, SQLException> function) - Throws:
SQLException
-
stringResult
public static String stringResult(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
stringResult
public static String stringResult(Connection connection, String statementString, Object... values) throws SQLException - Throws:
SQLException
-
stringResult
public static String stringResult(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
stringResult
public static String stringResult(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IOptional<IResult, throws SQLExceptionSQLException>, String, SQLException> resultFunction) - Throws:
SQLException
-
doubleResult
public static Double doubleResult(Connection connection, String statementString, Object... values) throws SQLException - Throws:
SQLException
-
doubleResult
public static Double doubleResult(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
longResult
public static Long longResult(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
longResult
public static Long longResult(Connection connection, String statementString, Object... values) throws SQLException - Throws:
SQLException
-
longResult
public static Long longResult(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
longResult
public static Long longResult(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IOptional<IResult, throws SQLExceptionSQLException>, Long, SQLException> resultFunction) - Throws:
SQLException
-
booleanResult
public static boolean booleanResult(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
booleanResult
public static boolean booleanResult(Connection connection, String statementString, Object... values) throws SQLException - Throws:
SQLException
-
booleanResult
public static boolean booleanResult(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
result
public static <T> T result(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IOptional<IResult, throws SQLExceptionSQLException>, T, SQLException> resultFunction) - Throws:
SQLException
-
result
public static <T> T result(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IConverter<IOptional<IResult, SQLException>, throws SQLExceptionT, SQLException> resultConverter) - Throws:
SQLException
-
result
public static <T> T result(ICanceler canceler, Connection connection, String statementString, IConverter<IOptional<IResult, SQLException>, throws SQLExceptionT, SQLException> converter) - Throws:
SQLException
-
result
public static <T> T result(Connection connection, String statementString, IConverter<IOptional<IResult, SQLException>, throws SQLExceptionT, SQLException> converter) - Throws:
SQLException
-
result
public static <T> T result(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IOptional<IResult, throws SQLExceptionSQLException>, T, SQLException> resultConverter) - Throws:
SQLException
-
result
public static <T> T result(ICanceler canceler, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IOptional<IResult, throws SQLExceptionSQLException>, T, SQLException> resultFunction) - Throws:
SQLException
-
result
public static <T> T result(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IOptional<IResult, throws SQLExceptionSQLException>, T, SQLException> resultFunction) - Throws:
SQLException
-
results
public static <T> List<T> results(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IConverter<IResult, T, throws SQLExceptionSQLException> function) - Throws:
SQLException
-
results
public static <T> List<T> results(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IResult, throws SQLExceptionT, SQLException> function) - Throws:
SQLException
-
results
public static <T> List<T> results(Connection connection, String statementString, IConverter<IResult, T, throws SQLExceptionSQLException> function) - Throws:
SQLException
-
results
public static <T> List<T> results(ICanceler canceler, Connection connection, String statementString, IConverter<IResult, T, throws SQLExceptionSQLException> resultConverter) - Throws:
SQLException
-
results
public static <T> List<T> results(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IConverter<IResult, T, throws SQLExceptionSQLException> resultConverter) - Throws:
SQLException
-
results
public static <T> List<T> results(ICanceler canceler, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IResult, throws SQLExceptionT, SQLException> resultConverter) - Throws:
SQLException
-
results
public static <T> List<T> results(Connection connection, String statementString, IInterruptableFunction<IResult, T, throws SQLException, CanceledExceptionSQLException> resultFunction) - Throws:
SQLExceptionCanceledException
-
results
public static <T> List<T> results(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IInterruptableFunction<IResult, T, throws SQLException, CanceledExceptionSQLException> resultFunction) - Throws:
SQLExceptionCanceledException
-
results
public static <T> List<T> results(Connection connection, String statementString, IInterruptableProcedure<PreparedStatement, SQLException> prepareClosure, IInterruptableFunction<IResult, throws SQLException, CanceledExceptionT, SQLException> resultFunction) - Throws:
SQLExceptionCanceledException
-
results
public static <T> List<T> results(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IInterruptableProcedure<PreparedStatement, SQLException> prepareProcedure, IInterruptableFunction<IResult, throws SQLException, CanceledExceptionT, SQLException> resultProcedure) - Throws:
SQLExceptionCanceledException
-
results
public static <T> List<T> results(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IResult, throws SQLExceptionT, SQLException> resultProcedure) - Throws:
SQLException
-
results
public static <T> List<T> results(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IResult, throws SQLExceptionT, SQLException> resultConverter) - Throws:
SQLException
-
aggregate
public static <T> T aggregate(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, IConverter<Iterable<IResult>, T, throws SQLExceptionSQLException> function) - Throws:
SQLException
-
aggregate
public static <T> T aggregate(Connection connection, String statementString, IConverter<Iterable<IResult>, T, throws SQLExceptionSQLException> function) - Throws:
SQLException
-
aggregate
public static <T> T aggregate(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<Iterable<IResult>, throws SQLExceptionT, SQLException> resultProcedure) - Throws:
SQLException
-
aggregate
public static <T> T aggregate(ICanceler canceler, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<Iterable<IResult>, throws SQLExceptionT, SQLException> resultProcedure) - Throws:
SQLException
-
aggregate
public static <T> T aggregate(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<Iterable<IResult>, throws SQLExceptionT, SQLException> resultProcedure) - Throws:
SQLException
-
call
public static final boolean call(Connection connection, String statementString, Object... values) throws SQLException - Throws:
SQLException
-
call
public static final boolean call(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> procedure) throws SQLException- Throws:
SQLException
-
call
public static boolean call(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IProcedure<ResultSet, throws SQLExceptionSQLException> resultProcedure) - Throws:
SQLException
-
setter
-
setter
-
interruptableStetter
public static IInterruptableProcedure<PreparedStatement,SQLException> interruptableStetter(Object... objects) -
interruptableStetter
public static IInterruptableProcedure<PreparedStatement,SQLException> interruptableStetter(List objects) -
adjustValue
-
count
public static int count(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String statementString, Object... values) throws SQLException - Throws:
SQLException
-
count
public static int count(Connection connection, String statementString, Object... values) throws SQLException - Throws:
SQLException
-
next
- Throws:
SQLException
-
count
public static int count(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
count
public static int count(PreparedStatement statement, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
contains
public static boolean contains(Connection connection, String statementString, String columnName, Object value) throws SQLException - Throws:
SQLException
-
exists
public static boolean exists(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription) -
update
public static List<Object> update(Connection connection, String statementString, String[] returnColumns, Object... values) throws SQLException - Throws:
SQLException
-
update
public static List<Object> update(Connection connection, String statementString, String[] returnColumns, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
update
public static List<Object> update(Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
update
public static List<Object> update(Connection connection, String statementString, Object... values) throws SQLException - Throws:
SQLException
-
update
public static List<Object> update(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String updatetStatement, String[] returnColumns, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
update
public static List<Object> update(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, String updatetStatement, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
foreach
public static void foreach(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConsumer<IResult, throws SQLExceptionSQLException> resultConsumer) - Throws:
SQLException
-
update
public static <I> ICloseableConsumer<I,Boolean, updateSQLException> (IObserverFactory cancelObserverFactory, Connection connection, String statementString, IConverter<I, List<IDatabaseValue>, SQLException> converter) -
update
public static <I> ICloseableConsumer<I,Boolean, updateSQLException> (IObserverFactory cancelObserverFactory, Connection connection, String statementString, IAggregator<PreparedStatement, I, Boolean, SQLException> aggregator) -
add
- Throws:
SQLException
-
add
public static void add(PreparedStatement statement, IProcedure<PreparedStatement, SQLException> prepareProcedure) throws SQLException- Throws:
SQLException
-
transfer
- Throws:
SQLException
-
value
-
value
-
query
public static <T> IClosableIterator<T,SQLException> query(IObserverFactory cancelObserverFactory, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IResult, T, SQLException> converter) -
createIfNotExists
public static void createIfNotExists(Connection connection, String schemaName, String tableName, String createStatementString) throws SQLException - Throws:
SQLException
-
exists
public static boolean exists(Connection connection, String schemaName, String tableName) throws SQLException - Throws:
SQLException
-
execute
- Throws:
SQLException
-
getAsString
-
createSelectStatement
-
createSelectStatement
-
createIdentifierSelectStatement
-
createIdentifierSelectStatement
-
getTableTypes
public static String[] getTableTypes(DatabaseMetaData metaData, IApplicable<String> applicableType) throws SQLException - Throws:
SQLException
-
create
- Throws:
SQLException
-
toString
- Throws:
SQLException
-
batchTransfer
public static IBatchTransfer batchTransfer(Connection connection, String tableName, String[] identifierNames, String[] valueNames) -
batchTransfer
public static IBatchTransfer batchTransfer(Connection connection, String selectExistsStatement, String insertStatement, String updateStatement) -
version
- Throws:
SQLException
-
iterator
public static IClosableIterator<IResult,SQLException> iterator(ICanceler canceler, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure) -
iterator
public static <T> IClosableIterator<T,SQLException> iterator(ICanceler canceler, Connection connection, String statementString, IProcedure<PreparedStatement, SQLException> prepareProcedure, IConverter<IResult, T, SQLException> resultConverter) -
iterator
public static IClosableIterator<IResult,SQLException> iterator(ICanceler canceler, PreparedStatement statement) -
iterator
public static <T> IClosableIterator<T,SQLException> iterator(ICanceler canceler, PreparedStatement statement, IConverter<IResult, T, SQLException> resultConverter) -
iterator
public static <T> IClosableIterator<T,SQLException> iterator(ICanceler canceler, ResultSet resultSet, IConverter<IResult, T, SQLException> resultConverter) -
metadatas
public static <T> List<T> metadatas(ICanceler canceler, Connection connection, IFactory<DatabaseMetaData, ResultSet, throws SQLExceptionSQLException> resultSetFactory, IConverter<ResultSet, T, SQLException> resultConverter) - Throws:
SQLException
-
getInteger
- Throws:
SQLException
-
getLong
- Throws:
SQLException
-
getDouble
- Throws:
SQLException
-
silent
-
silent
-
commit
public static void commit(Connection connection, IntCounter executeCounter, SQLException exception) throws SQLException - Throws:
SQLException
-
rollback
public static SQLException rollback(Connection connection, IntCounter executeCounter, SQLException exception) -
setValueToStatement
public static void setValueToStatement(Connection connection, PreparedStatement statement, int i, IDatabaseValue value) throws SQLException - Throws:
SQLException
-
executeBatch
public static int executeBatch(IntCounter insertCounter, IntCounter executeCounter, PreparedStatement statement) throws SQLException - Throws:
SQLException
-
createStatement
public static PreparedStatement createStatement(Connection connection, String statementString) throws SQLException - Throws:
SQLException
-
isSupported
-
openLogWriter
public static void openLogWriter() -
closeLogWriter
public static void closeLogWriter()
-