Package net.anwiba.commons.jdbc
Class DatabaseUtilities
- java.lang.Object
-
- net.anwiba.commons.jdbc.DatabaseUtilities
-
public class DatabaseUtilities extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description DatabaseUtilities()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidadd(java.sql.PreparedStatement statement, java.lang.Object... values)static voidadd(java.sql.PreparedStatement statement, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure)static java.lang.ObjectadjustValue(java.lang.Object value)static <T> Taggregate(java.sql.Connection connection, java.lang.String statementString, IConverter<java.lang.Iterable<IResult>,T,java.sql.SQLException> function)static <T> Taggregate(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<java.lang.Iterable<IResult>,T,java.sql.SQLException> resultProcedure)static <T> Taggregate(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IConverter<java.lang.Iterable<IResult>,T,java.sql.SQLException> function)static IBatchTransferbatchTransfer(java.sql.Connection connection, java.lang.String tableName, java.lang.String[] identifierNames, java.lang.String[] valueNames)static IBatchTransferbatchTransfer(java.sql.Connection connection, java.lang.String selectExistsStatement, java.lang.String insertStatement, java.lang.String updateStatement)static booleanbooleanResult(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values)static booleanbooleanResult(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure)static booleanbooleanResult(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure)static booleancall(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values)static booleancall(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> procedure)static booleancall(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IProcedure<java.sql.ResultSet,java.sql.SQLException> resultProcedure)static voidclose(java.sql.Connection connection)static java.sql.SQLExceptionclose(java.sql.Connection connection, java.sql.SQLException exception)static voidclose(java.sql.ResultSet resultSet)static java.sql.SQLExceptionclose(java.sql.ResultSet resultSet, java.sql.SQLException exception)static voidclose(java.sql.Statement statement)static java.sql.SQLExceptionclose(java.sql.Statement statement, java.sql.SQLException exception)static voidclose(IResults results)static java.sql.SQLExceptionclose(IResults results, java.sql.SQLException exception)static <O> java.sql.SQLExceptionclose(IClosableIterator<O,java.sql.SQLException> iteratror, java.sql.SQLException exception)static booleancontains(java.sql.Connection connection, java.lang.String statementString, java.lang.String columnName, java.lang.Object value)static intcount(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values)static intcount(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure)static intcount(java.sql.PreparedStatement statement, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure)static intcount(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, java.lang.Object... values)static booleancreate(java.sql.Connection connection, java.lang.String statementString)static java.sql.ConnectioncreateConnection(java.lang.String url, java.lang.String user, java.lang.String password)static java.sql.ConnectioncreateConnection(java.lang.String url, java.lang.String user, java.lang.String password, boolean isReadOnly)static java.lang.StringcreateIdentifierSelectStatement(java.lang.String tableName, java.lang.String identifierColumnName, java.lang.Iterable<java.lang.String> valueColumnNames)static java.lang.StringcreateIdentifierSelectStatement(java.lang.String tableName, java.lang.String identifierColumnName, java.lang.String orderByColumnName, java.lang.Iterable<java.lang.String> valueColumnNames)static voidcreateIfNotExists(java.sql.Connection connection, java.lang.String schemaName, java.lang.String tableName, java.lang.String createStatementString)static java.lang.StringcreateSelectStatement(java.lang.String tableName, java.lang.Iterable<java.lang.String> columnNames, java.lang.Iterable<java.lang.String> valueColumnNames)static java.lang.StringcreateSelectStatement(java.lang.String tableName, java.lang.Iterable<java.lang.String> conditionColumnNames, java.lang.String orderByColumnName, java.lang.Iterable<java.lang.String> resultColumnNames)static voiddropIndex(java.sql.Connection connection, java.lang.String schemaName, java.lang.String indexName)static voiddropTable(java.sql.Connection connection, java.lang.String schemaName, java.lang.String tableName)static voidexecute(java.sql.Connection connection, java.io.File file)static booleanexecute(java.sql.Connection connection, java.lang.String statementString)static booleanexecute(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values)static booleanexecute(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> procedure)static booleanexecute(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IProcedure<java.sql.ResultSet,java.sql.SQLException> resultProcedure)static booleanexecute(java.sql.Statement statement, java.lang.String statementString)static voidexecute(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, IProcedure<java.sql.Connection,java.sql.SQLException> procedure)static booleanexists(java.sql.Connection connection, java.lang.String schemaName, java.lang.String tableName)static booleanexists(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription)static voidforeach(IFactory<IBlock<java.lang.RuntimeException>,IWatcher,java.lang.RuntimeException> cancelWatcherFactory, java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConsumer<IResult,java.sql.SQLException> resultConsumer)static java.lang.StringgetAsString(java.sql.Statement statement, java.lang.String statementString)static ConstraintgetConstraint(java.util.Map<java.lang.String,Constraint> constraints, java.lang.String constraintName, ConstraintType constraintType, java.lang.String condition)static intgetMajorVersion(java.sql.Connection connection)static intgetMinorVersion(java.sql.Connection connection)static java.lang.StringgetOwner(java.sql.Connection connection, java.lang.String owner)static java.lang.StringgetProduct(java.sql.Connection connection)static java.lang.StringgetSchemaName(java.sql.Connection connection, java.lang.String schemaName)static java.lang.StringgetStatementString(java.sql.Connection connection, double beforVersion, java.lang.String statement, java.lang.String defaultStatement)static java.lang.String[]getTableTypes(java.sql.DatabaseMetaData metaData, IApplicable<java.lang.String> applicableType)static java.lang.StringgetVersion(java.sql.Connection connection)static doublegetVersionAsDouble(java.sql.Connection connection)static java.sql.DriverloadDriver(java.lang.String driverName)static java.lang.LonglongResult(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values)static java.lang.LonglongResult(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure)static java.lang.LonglongResult(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IOptional<IResult,java.sql.SQLException>,java.lang.Long,java.sql.SQLException> resultFunction)static java.lang.LonglongResult(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure)static java.lang.Longnext(java.sql.Connection connection, java.lang.String nextValueStatement)static <T> IClosableIterator<T,java.sql.SQLException>query(IFactory<IBlock<java.lang.RuntimeException>,IWatcher,java.lang.RuntimeException> cancelWatcherFactory, java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IResult,T,java.sql.SQLException> converter)static java.util.Map<java.lang.String,Constraint>readConstraints(java.sql.Connection connection, java.lang.String selectStatement, java.lang.String schemaName, java.lang.String tableName)static <T> Tresult(java.sql.Connection connection, java.lang.String statementString, IConverter<IOptional<IResult,java.sql.SQLException>,T,java.sql.SQLException> function)static <T> Tresult(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IOptional<IResult,java.sql.SQLException>,T,java.sql.SQLException> resultFunction)static <T> Tresult(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IConverter<IOptional<IResult,java.sql.SQLException>,T,java.sql.SQLException> resultFunction)static <T> Tresult(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IOptional<IResult,java.sql.SQLException>,T,java.sql.SQLException> resultFunction)static <T> Tresult(IFactory<IBlock<java.lang.RuntimeException>,IWatcher,java.lang.RuntimeException> cancelWatcherFactory, java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IOptional<IResult,java.sql.SQLException>,T,java.sql.SQLException> resultFunction)static <T> java.util.List<T>results(java.sql.Connection connection, java.lang.String statementString, IConverter<IResult,T,java.sql.SQLException> function)static <T> java.util.List<T>results(java.sql.Connection connection, java.lang.String statementString, IInterruptableFunction<IResult,T,java.sql.SQLException> resultFunction)static <T> java.util.List<T>results(java.sql.Connection connection, java.lang.String statementString, IInterruptableProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareClosure, IInterruptableFunction<IResult,T,java.sql.SQLException> resultFunction)static <T> java.util.List<T>results(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IResult,T,java.sql.SQLException> resultProcedure)static <T> java.util.List<T>results(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IConverter<IResult,T,java.sql.SQLException> function)static <T> java.util.List<T>results(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IInterruptableFunction<IResult,T,java.sql.SQLException> resultFunction)static <T> java.util.List<T>results(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IResult,T,java.sql.SQLException> function)static <T> java.util.List<T>results(IFactory<IBlock<java.lang.RuntimeException>,IWatcher,java.lang.RuntimeException> cancelWatcherFactory, java.sql.Connection connection, java.lang.String statementString, IConverter<IResult,T,java.sql.SQLException> resultFunction)static <T> java.util.List<T>results(IFactory<IBlock<java.lang.RuntimeException>,IWatcher,java.lang.RuntimeException> cancelWatcherFactory, java.sql.Connection connection, java.lang.String statementString, IInterruptableProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareClosure, IInterruptableFunction<IResult,T,java.sql.SQLException> resultProcedure)static <T> java.util.List<T>results(IFactory<IBlock<java.lang.RuntimeException>,IWatcher,java.lang.RuntimeException> cancelWatcherFactory, java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IResult,T,java.sql.SQLException> resultConverter)static java.sql.ResultSetresultSet(java.sql.Connection connection, java.lang.String string)static <T> java.sql.ResultSetresultSet(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure)static IProcedure<java.sql.PreparedStatement,java.sql.SQLException>setterProcedur(java.lang.Object... objects)static IProcedure<java.sql.PreparedStatement,java.sql.SQLException>setterProcedur(java.util.List objects)static java.lang.StringstringResult(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values)static java.lang.StringstringResult(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure)static java.lang.StringstringResult(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IOptional<IResult,java.sql.SQLException>,java.lang.String,java.sql.SQLException> resultFunction)static java.lang.StringstringResult(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure)static java.lang.StringtoString(java.sql.ResultSet resultSet)static int[]transfer(java.sql.PreparedStatement statement)static java.util.List<java.lang.Object>update(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values)static java.util.List<java.lang.Object>update(java.sql.Connection connection, java.lang.String statementString, java.lang.String[] returnColumns, java.lang.Object... values)static java.util.List<java.lang.Object>update(java.sql.Connection connection, java.lang.String statementString, java.lang.String[] returnColumns, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure)static java.util.List<java.lang.Object>update(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure)static java.util.List<java.lang.Object>update(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String updatetStatement, java.lang.String[] returnColumns, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure)static java.util.List<java.lang.Object>update(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String updatetStatement, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure)static <I> ICloseableConsumer<I,java.lang.Boolean,java.sql.SQLException>update(IFactory<IBlock<java.lang.RuntimeException>,IWatcher,java.lang.RuntimeException> cancelWatcherFactory, java.sql.Connection connection, java.lang.String statementString, IAggregator<java.sql.PreparedStatement,I,java.lang.Boolean,java.sql.SQLException> aggregator)static <I> ICloseableConsumer<I,java.lang.Boolean,java.sql.SQLException>update(IFactory<IBlock<java.lang.RuntimeException>,IWatcher,java.lang.RuntimeException> cancelWatcherFactory, java.sql.Connection connection, java.lang.String statementString, IConverter<I,java.util.List<IDatabaseValue>,java.sql.SQLException> converter)IDatabaseValuevalue(java.lang.Object object, int type)IDatabaseValuevalue(java.lang.Object object, int type, java.lang.String typeName)static IVersionversion(java.sql.Connection connection)
-
-
-
Method Detail
-
loadDriver
public static java.sql.Driver loadDriver(java.lang.String driverName)
-
createConnection
public static java.sql.Connection createConnection(java.lang.String url, java.lang.String user, java.lang.String password, boolean isReadOnly) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
createConnection
public static java.sql.Connection createConnection(java.lang.String url, java.lang.String user, java.lang.String password) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
close
public static void close(java.sql.Connection connection)
-
close
public static <O> java.sql.SQLException close(IClosableIterator<O,java.sql.SQLException> iteratror, java.sql.SQLException exception)
-
close
public static java.sql.SQLException close(java.sql.Connection connection, java.sql.SQLException exception)
-
close
public static java.sql.SQLException close(java.sql.Statement statement, java.sql.SQLException exception)
-
close
public static java.sql.SQLException close(java.sql.ResultSet resultSet, java.sql.SQLException exception)
-
close
public static java.sql.SQLException close(IResults results, java.sql.SQLException exception)
-
close
public static void close(IResults results)
-
close
public static void close(java.sql.Statement statement)
-
close
public static void close(java.sql.ResultSet resultSet)
-
getStatementString
public static java.lang.String getStatementString(java.sql.Connection connection, double beforVersion, java.lang.String statement, java.lang.String defaultStatement) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getVersionAsDouble
public static double getVersionAsDouble(java.sql.Connection connection) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getProduct
public static java.lang.String getProduct(java.sql.Connection connection) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getVersion
public static java.lang.String getVersion(java.sql.Connection connection) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getMajorVersion
public static int getMajorVersion(java.sql.Connection connection) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getMinorVersion
public static int getMinorVersion(java.sql.Connection connection) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
readConstraints
public static java.util.Map<java.lang.String,Constraint> readConstraints(java.sql.Connection connection, java.lang.String selectStatement, java.lang.String schemaName, java.lang.String tableName) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getConstraint
public static Constraint getConstraint(java.util.Map<java.lang.String,Constraint> constraints, java.lang.String constraintName, ConstraintType constraintType, java.lang.String condition)
-
dropTable
public static void dropTable(java.sql.Connection connection, java.lang.String schemaName, java.lang.String tableName) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
dropIndex
public static void dropIndex(java.sql.Connection connection, java.lang.String schemaName, java.lang.String indexName) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getOwner
public static java.lang.String getOwner(java.sql.Connection connection, java.lang.String owner) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
results
public static <T> java.util.List<T> results(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IConverter<IResult,T,java.sql.SQLException> function) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
results
public static <T> java.util.List<T> results(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IResult,T,java.sql.SQLException> function) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
results
public static <T> java.util.List<T> results(java.sql.Connection connection, java.lang.String statementString, IConverter<IResult,T,java.sql.SQLException> function) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
results
public static <T> java.util.List<T> results(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IResult,T,java.sql.SQLException> resultProcedure) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
results
public static <T> java.util.List<T> results(IFactory<IBlock<java.lang.RuntimeException>,IWatcher,java.lang.RuntimeException> cancelWatcherFactory, java.sql.Connection connection, java.lang.String statementString, IConverter<IResult,T,java.sql.SQLException> resultFunction) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
results
public static <T> java.util.List<T> results(IFactory<IBlock<java.lang.RuntimeException>,IWatcher,java.lang.RuntimeException> cancelWatcherFactory, java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IResult,T,java.sql.SQLException> resultConverter) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
foreach
public static void foreach(IFactory<IBlock<java.lang.RuntimeException>,IWatcher,java.lang.RuntimeException> cancelWatcherFactory, java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConsumer<IResult,java.sql.SQLException> resultConsumer) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
resultSet
public static java.sql.ResultSet resultSet(java.sql.Connection connection, java.lang.String string) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
resultSet
public static <T> java.sql.ResultSet resultSet(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
stringResult
public static java.lang.String stringResult(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
stringResult
public static java.lang.String stringResult(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
stringResult
public static java.lang.String stringResult(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
stringResult
public static java.lang.String stringResult(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IOptional<IResult,java.sql.SQLException>,java.lang.String,java.sql.SQLException> resultFunction) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
longResult
public static java.lang.Long longResult(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
longResult
public static java.lang.Long longResult(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
longResult
public static java.lang.Long longResult(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
longResult
public static java.lang.Long longResult(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IOptional<IResult,java.sql.SQLException>,java.lang.Long,java.sql.SQLException> resultFunction) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
booleanResult
public static boolean booleanResult(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
booleanResult
public static boolean booleanResult(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
booleanResult
public static boolean booleanResult(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
result
public static <T> T result(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IOptional<IResult,java.sql.SQLException>,T,java.sql.SQLException> resultFunction) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
result
public static <T> T result(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IConverter<IOptional<IResult,java.sql.SQLException>,T,java.sql.SQLException> resultFunction) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
result
public static <T> T result(java.sql.Connection connection, java.lang.String statementString, IConverter<IOptional<IResult,java.sql.SQLException>,T,java.sql.SQLException> function) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
result
public static <T> T result(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IOptional<IResult,java.sql.SQLException>,T,java.sql.SQLException> resultFunction) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
result
public static <T> T result(IFactory<IBlock<java.lang.RuntimeException>,IWatcher,java.lang.RuntimeException> cancelWatcherFactory, java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IOptional<IResult,java.sql.SQLException>,T,java.sql.SQLException> resultFunction) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
results
public static <T> java.util.List<T> results(java.sql.Connection connection, java.lang.String statementString, IInterruptableFunction<IResult,T,java.sql.SQLException> resultFunction) throws java.sql.SQLException, CanceledException- Throws:
java.sql.SQLExceptionCanceledException
-
results
public static <T> java.util.List<T> results(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IInterruptableFunction<IResult,T,java.sql.SQLException> resultFunction) throws java.sql.SQLException, CanceledException
- Throws:
java.sql.SQLExceptionCanceledException
-
results
public static <T> java.util.List<T> results(java.sql.Connection connection, java.lang.String statementString, IInterruptableProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareClosure, IInterruptableFunction<IResult,T,java.sql.SQLException> resultFunction) throws java.sql.SQLException, CanceledException- Throws:
java.sql.SQLExceptionCanceledException
-
results
public static <T> java.util.List<T> results(IFactory<IBlock<java.lang.RuntimeException>,IWatcher,java.lang.RuntimeException> cancelWatcherFactory, java.sql.Connection connection, java.lang.String statementString, IInterruptableProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareClosure, IInterruptableFunction<IResult,T,java.sql.SQLException> resultProcedure) throws java.sql.SQLException, CanceledException
- Throws:
java.sql.SQLExceptionCanceledException
-
aggregate
public static <T> T aggregate(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IConverter<java.lang.Iterable<IResult>,T,java.sql.SQLException> function) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
aggregate
public static <T> T aggregate(java.sql.Connection connection, java.lang.String statementString, IConverter<java.lang.Iterable<IResult>,T,java.sql.SQLException> function) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
aggregate
public static <T> T aggregate(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<java.lang.Iterable<IResult>,T,java.sql.SQLException> resultProcedure) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
execute
public static boolean execute(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IProcedure<java.sql.ResultSet,java.sql.SQLException> resultProcedure) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
execute
public static final boolean execute(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
call
public static final boolean call(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
call
public static final boolean call(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> procedure) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
call
public static boolean call(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IProcedure<java.sql.ResultSet,java.sql.SQLException> resultProcedure) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
setterProcedur
public static IProcedure<java.sql.PreparedStatement,java.sql.SQLException> setterProcedur(java.util.List objects)
-
setterProcedur
public static IProcedure<java.sql.PreparedStatement,java.sql.SQLException> setterProcedur(java.lang.Object... objects)
-
adjustValue
public static java.lang.Object adjustValue(java.lang.Object value)
-
count
public static int count(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, java.lang.Object... values) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
count
public static int count(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
next
public static java.lang.Long next(java.sql.Connection connection, java.lang.String nextValueStatement) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
count
public static int count(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
count
public static int count(java.sql.PreparedStatement statement, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
contains
public static boolean contains(java.sql.Connection connection, java.lang.String statementString, java.lang.String columnName, java.lang.Object value) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
execute
public static boolean execute(java.sql.Connection connection, java.lang.String statementString) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
execute
public static final boolean execute(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> procedure) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
execute
public static void execute(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, IProcedure<java.sql.Connection,java.sql.SQLException> procedure) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
exists
public static boolean exists(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription)
-
update
public static java.util.List<java.lang.Object> update(java.sql.Connection connection, java.lang.String statementString, java.lang.String[] returnColumns, java.lang.Object... values) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
update
public static java.util.List<java.lang.Object> update(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String updatetStatement, java.lang.String[] returnColumns, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
update
public static java.util.List<java.lang.Object> update(java.sql.Connection connection, java.lang.String statementString, java.lang.String[] returnColumns, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
update
public static java.util.List<java.lang.Object> update(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
update
public static java.util.List<java.lang.Object> update(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String updatetStatement, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
update
public static java.util.List<java.lang.Object> update(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
update
public static <I> ICloseableConsumer<I,java.lang.Boolean,java.sql.SQLException> update(IFactory<IBlock<java.lang.RuntimeException>,IWatcher,java.lang.RuntimeException> cancelWatcherFactory, java.sql.Connection connection, java.lang.String statementString, IConverter<I,java.util.List<IDatabaseValue>,java.sql.SQLException> converter)
-
update
public static <I> ICloseableConsumer<I,java.lang.Boolean,java.sql.SQLException> update(IFactory<IBlock<java.lang.RuntimeException>,IWatcher,java.lang.RuntimeException> cancelWatcherFactory, java.sql.Connection connection, java.lang.String statementString, IAggregator<java.sql.PreparedStatement,I,java.lang.Boolean,java.sql.SQLException> aggregator)
-
add
public static void add(java.sql.PreparedStatement statement, java.lang.Object... values) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
add
public static void add(java.sql.PreparedStatement statement, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
transfer
public static int[] transfer(java.sql.PreparedStatement statement) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
value
public IDatabaseValue value(java.lang.Object object, int type)
-
value
public IDatabaseValue value(java.lang.Object object, int type, java.lang.String typeName)
-
query
public static <T> IClosableIterator<T,java.sql.SQLException> query(IFactory<IBlock<java.lang.RuntimeException>,IWatcher,java.lang.RuntimeException> cancelWatcherFactory, java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,java.sql.SQLException> prepareProcedure, IConverter<IResult,T,java.sql.SQLException> converter)
-
getSchemaName
public static java.lang.String getSchemaName(java.sql.Connection connection, java.lang.String schemaName) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
createIfNotExists
public static void createIfNotExists(java.sql.Connection connection, java.lang.String schemaName, java.lang.String tableName, java.lang.String createStatementString) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
exists
public static boolean exists(java.sql.Connection connection, java.lang.String schemaName, java.lang.String tableName) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
execute
public static boolean execute(java.sql.Statement statement, java.lang.String statementString) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getAsString
public static java.lang.String getAsString(java.sql.Statement statement, java.lang.String statementString)
-
createSelectStatement
public static java.lang.String createSelectStatement(java.lang.String tableName, java.lang.Iterable<java.lang.String> columnNames, java.lang.Iterable<java.lang.String> valueColumnNames)
-
createSelectStatement
public static java.lang.String createSelectStatement(java.lang.String tableName, java.lang.Iterable<java.lang.String> conditionColumnNames, java.lang.String orderByColumnName, java.lang.Iterable<java.lang.String> resultColumnNames)
-
createIdentifierSelectStatement
public static java.lang.String createIdentifierSelectStatement(java.lang.String tableName, java.lang.String identifierColumnName, java.lang.Iterable<java.lang.String> valueColumnNames)
-
createIdentifierSelectStatement
public static java.lang.String createIdentifierSelectStatement(java.lang.String tableName, java.lang.String identifierColumnName, java.lang.String orderByColumnName, java.lang.Iterable<java.lang.String> valueColumnNames)
-
getTableTypes
public static java.lang.String[] getTableTypes(java.sql.DatabaseMetaData metaData, IApplicable<java.lang.String> applicableType) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
create
public static boolean create(java.sql.Connection connection, java.lang.String statementString) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
toString
public static java.lang.String toString(java.sql.ResultSet resultSet) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
batchTransfer
public static IBatchTransfer batchTransfer(java.sql.Connection connection, java.lang.String tableName, java.lang.String[] identifierNames, java.lang.String[] valueNames)
-
batchTransfer
public static IBatchTransfer batchTransfer(java.sql.Connection connection, java.lang.String selectExistsStatement, java.lang.String insertStatement, java.lang.String updateStatement)
-
execute
public static void execute(java.sql.Connection connection, java.io.File file) throws java.io.FileNotFoundException, java.io.IOException, java.sql.SQLException- Throws:
java.io.FileNotFoundExceptionjava.io.IOExceptionjava.sql.SQLException
-
version
public static IVersion version(java.sql.Connection connection) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-