public static int countEntity(final DataSource dataSource, final String tableName) {
        try (final Connection connection = dataSource.getConnection()) {
            return countEntity(connection, tableName);
        } catch (SQLException e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }
Attempts to connect to the database using the passed connection details. If it fails
it will log a warning, and keep retrying. The retry interval will steadily increase.
<p>
If the connection could not be established and the reason for the failure makes a
retry pointless, e.g. invalid password, then an exception will be thrown.
stroom-db-util/src/main/java/stroom/db/util/DbUtil.java