Class DatabaseUtilities


  • public class DatabaseUtilities
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void add​(java.sql.PreparedStatement statement, java.lang.Object... values)  
      static void add​(java.sql.PreparedStatement statement, IProcedure<java.sql.PreparedStatement,​java.sql.SQLException> prepareProcedure)  
      static java.lang.Object adjustValue​(java.lang.Object value)  
      static <T> T aggregate​(java.sql.Connection connection, java.lang.String statementString, IConverter<java.lang.Iterable<IResult>,​T,​java.sql.SQLException> function)  
      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)  
      static <T> T aggregate​(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IConverter<java.lang.Iterable<IResult>,​T,​java.sql.SQLException> function)  
      static IBatchTransfer batchTransfer​(java.sql.Connection connection, java.lang.String tableName, java.lang.String[] identifierNames, java.lang.String[] valueNames)  
      static IBatchTransfer batchTransfer​(java.sql.Connection connection, java.lang.String selectExistsStatement, java.lang.String insertStatement, java.lang.String updateStatement)  
      static boolean booleanResult​(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values)  
      static boolean booleanResult​(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,​java.sql.SQLException> prepareProcedure)  
      static boolean booleanResult​(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,​java.sql.SQLException> prepareProcedure)  
      static boolean call​(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values)  
      static boolean call​(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,​java.sql.SQLException> procedure)  
      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)  
      static void close​(java.sql.Connection connection)  
      static java.sql.SQLException close​(java.sql.Connection connection, java.sql.SQLException exception)  
      static void close​(java.sql.ResultSet resultSet)  
      static java.sql.SQLException close​(java.sql.ResultSet resultSet, java.sql.SQLException exception)  
      static void close​(java.sql.Statement statement)  
      static java.sql.SQLException close​(java.sql.Statement statement, java.sql.SQLException exception)  
      static void close​(IResults results)  
      static java.sql.SQLException close​(IResults results, java.sql.SQLException exception)  
      static <O> java.sql.SQLException close​(IClosableIterator<O,​java.sql.SQLException> iteratror, java.sql.SQLException exception)  
      static boolean contains​(java.sql.Connection connection, java.lang.String statementString, java.lang.String columnName, java.lang.Object value)  
      static int count​(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values)  
      static int count​(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,​java.sql.SQLException> prepareProcedure)  
      static int count​(java.sql.PreparedStatement statement, IProcedure<java.sql.PreparedStatement,​java.sql.SQLException> prepareProcedure)  
      static int count​(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, java.lang.Object... values)  
      static boolean create​(java.sql.Connection connection, java.lang.String statementString)  
      static java.sql.Connection createConnection​(java.lang.String url, java.lang.String user, java.lang.String password)  
      static java.sql.Connection createConnection​(java.lang.String url, java.lang.String user, java.lang.String password, boolean isReadOnly)  
      static java.lang.String createIdentifierSelectStatement​(java.lang.String tableName, java.lang.String identifierColumnName, java.lang.Iterable<java.lang.String> valueColumnNames)  
      static java.lang.String createIdentifierSelectStatement​(java.lang.String tableName, java.lang.String identifierColumnName, java.lang.String orderByColumnName, java.lang.Iterable<java.lang.String> valueColumnNames)  
      static void createIfNotExists​(java.sql.Connection connection, java.lang.String schemaName, java.lang.String tableName, java.lang.String createStatementString)  
      static java.lang.String createSelectStatement​(java.lang.String tableName, java.lang.Iterable<java.lang.String> columnNames, java.lang.Iterable<java.lang.String> valueColumnNames)  
      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)  
      static void dropIndex​(java.sql.Connection connection, java.lang.String schemaName, java.lang.String indexName)  
      static void dropTable​(java.sql.Connection connection, java.lang.String schemaName, java.lang.String tableName)  
      static void execute​(java.sql.Connection connection, java.io.File file)  
      static boolean execute​(java.sql.Connection connection, java.lang.String statementString)  
      static boolean execute​(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values)  
      static boolean execute​(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,​java.sql.SQLException> procedure)  
      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)  
      static boolean execute​(java.sql.Statement statement, java.lang.String statementString)  
      static void execute​(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, IProcedure<java.sql.Connection,​java.sql.SQLException> procedure)  
      static boolean exists​(java.sql.Connection connection, java.lang.String schemaName, java.lang.String tableName)  
      static boolean exists​(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription)  
      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)  
      static java.lang.String getAsString​(java.sql.Statement statement, java.lang.String statementString)  
      static Constraint getConstraint​(java.util.Map<java.lang.String,​Constraint> constraints, java.lang.String constraintName, ConstraintType constraintType, java.lang.String condition)  
      static int getMajorVersion​(java.sql.Connection connection)  
      static int getMinorVersion​(java.sql.Connection connection)  
      static java.lang.String getOwner​(java.sql.Connection connection, java.lang.String owner)  
      static java.lang.String getProduct​(java.sql.Connection connection)  
      static java.lang.String getSchemaName​(java.sql.Connection connection, java.lang.String schemaName)  
      static java.lang.String getStatementString​(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.String getVersion​(java.sql.Connection connection)  
      static double getVersionAsDouble​(java.sql.Connection connection)  
      static java.sql.Driver loadDriver​(java.lang.String driverName)  
      static java.lang.Long longResult​(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values)  
      static java.lang.Long longResult​(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,​java.sql.SQLException> prepareProcedure)  
      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)  
      static java.lang.Long longResult​(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,​java.sql.SQLException> prepareProcedure)  
      static java.lang.Long next​(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> T result​(java.sql.Connection connection, java.lang.String statementString, IConverter<IOptional<IResult,​java.sql.SQLException>,​T,​java.sql.SQLException> function)  
      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)  
      static <T> T result​(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IConverter<IOptional<IResult,​java.sql.SQLException>,​T,​java.sql.SQLException> resultFunction)  
      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)  
      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)  
      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.ResultSet resultSet​(java.sql.Connection connection, java.lang.String string)  
      static <T> java.sql.ResultSet resultSet​(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.String stringResult​(java.sql.Connection connection, java.lang.String statementString, java.lang.Object... values)  
      static java.lang.String stringResult​(java.sql.Connection connection, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,​java.sql.SQLException> prepareProcedure)  
      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)  
      static java.lang.String stringResult​(IDatabaseConnector connector, IJdbcConnectionDescription connectionDescription, java.lang.String statementString, IProcedure<java.sql.PreparedStatement,​java.sql.SQLException> prepareProcedure)  
      static java.lang.String toString​(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)  
      IDatabaseValue value​(java.lang.Object object, int type)  
      IDatabaseValue value​(java.lang.Object object, int type, java.lang.String typeName)  
      static IVersion version​(java.sql.Connection connection)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DatabaseUtilities

        public DatabaseUtilities()
    • 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,
                                                    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​(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
      • 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
      • 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.FileNotFoundException
        java.io.IOException
        java.sql.SQLException
      • version

        public static IVersion version​(java.sql.Connection connection)
                                throws java.sql.SQLException
        Throws:
        java.sql.SQLException