src/main/java/tracer/database/PgConn.java
/**
     * Query the database and return a value.
     * @param action Action to perform.
     * @param <X> Type of result to expect.
     * @return Database's result in given type.
     * @throws SQLException If something went wrong while
     * performing transaction.
     */
Query the database and return a value.
@param action Action to perform.
@param  Type of result to expect.
@return Database's result in given type.
@throws SQLException If something went wrong while
performing transaction.
Query the database and return a value . @param action Action to perform . @param Type of result to expect . @return Database ' s result in given type . @throws SQLException If something went wrong while performing transaction .
public static <X> X demand(DatabaseAction<X> action) throws SQLException {
        Objects.requireNonNull(action);
        try (final Connection conn = getConnection()) {
            return action.doInConnection(conn);
        }
    }
public static < X > X demand ( DatabaseAction < X > action ) throws SQLException { Objects . requireNonNull ( action ) ; try ( final Connection conn = getConnection ( ) ) { return action . doInConnection ( conn ) ; } }
Query the database and return a value.
Query the database and return a value .