public static long executeSqlForLong(final Connection connection, final String sql) throws SchemaCrawlerException { final Object longValue = executeSqlForScalar(connection, sql); // Error checking if (longValue == null || !(longValue instanceof Number)) { throw new SchemaCrawlerException("Cannot get an integer value result from SQL"); } return ((Number) longValue).longValue(); }
public static long executeSqlForLong(final Connection connection, final String sql) throws SchemaCrawlerException { final Object longValue = executeSqlForScalar(connection, sql); // Error checking if (longValue == null || !(longValue instanceof Number)) { throw new SchemaCrawlerException("Cannot get an integer value result from SQL"); } return ((Number) longValue).longValue(); }
public static Object executeForScalar(final Query query, final Connection connection) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForScalar(connection, sql); }
public static Object executeForScalar(final Query query, final Connection connection, final Table table, final Identifiers identifiers) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query, table, true, identifiers); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForScalar(connection, sql); }
public static Object executeForScalar(final Query query, final Connection connection) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForScalar(connection, sql); }
public static Object executeForScalar(final Query query, final Connection connection, final Table table, final Identifiers identifiers) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query, table, true, identifiers); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForScalar(connection, sql); }
public static long executeSqlForLong(final Connection connection, final String sql) throws SchemaCrawlerException { final Object longValue = executeSqlForScalar(connection, sql); // Error checking if (longValue == null || !(longValue instanceof Number)) { throw new SchemaCrawlerException("Cannot get an integer value result from SQL"); } return ((Number) longValue).longValue(); }
public static long executeSqlForLong(final Connection connection, final String sql) throws SchemaCrawlerException { final Object longValue = executeSqlForScalar(connection, sql); // Error checking if (longValue == null || !(longValue instanceof Number)) { throw new SchemaCrawlerException("Cannot get an integer value result from SQL"); } return ((Number) longValue).longValue(); }
public static Object executeForScalar(final Query query, final Connection connection) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForScalar(connection, sql); }
public static Object executeForScalar(final Query query, final Connection connection, final Table table, final Identifiers identifiers) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query, table, true, identifiers); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForScalar(connection, sql); }
public static Object executeForScalar(final Query query, final Connection connection) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForScalar(connection, sql); }
public static Object executeForScalar(final Query query, final Connection connection, final Table table, final Identifiers identifiers) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query, table, true, identifiers); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForScalar(connection, sql); }