Retrieves whether this database supports the given concurrency type in combination with the given result set type.
340926
@Override
    public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException
    {
        checkClosed();
        if (type == ResultSet.TYPE_SCROLL_INSENSITIVE && concurrency == ResultSet.CONCUR_READ_ONLY)
            return true;
        return false;
    }
1030389
private ResultSet getNextResultSet() throws SQLException {
        ResultSet result = null;

        while (stmt.getMoreResults() == true) {

            // when gerMoreResults are returned - some drivers close previous ResultSets - therefore we cannot read them again.
            if (this.type == Type.UPDATE_SCROLL || this.type == Type.READ_ONLY_SCROLL) {
                throw new MjdbcSQLException("Lazy cache scroll does not support Multiple ResultSets. Pleae use" +
                        "non-scrollable lazy handlers or cached output handlers.");
            }

            if (closedResultSet.contains(result) == false) {
                result = stmt.getResultSet();
                break;
            }
        }

        return result;
    }
95811
@Deprecated
    public C verify(int allowedStatements, Threads threadMatcher) throws WrongNumberOfQueriesError {
        return verify(SqlQueries.exactQueries(allowedStatements).threads(threadMatcher));
    }
758572
private static Class<?> getConcreteType(final Class<?> rawType, final boolean returnNullIfNotMapOrCollection) {
        // This list is not complete (e.g. EnumMap cannot be instantiated directly, you need to pass the
        // enum key type into a factory method), but this should cover a lot of the common types
        if (rawType == Map.class || rawType == AbstractMap.class || rawType == HashMap.class) {
            return HashMap.class;
        } else if (rawType == ConcurrentMap.class || rawType == ConcurrentHashMap.class) {
            return ConcurrentHashMap.class;
        } else if (rawType == SortedMap.class || rawType == NavigableMap.class || rawType == TreeMap.class) {
            return TreeMap.class;
        } else if (rawType == ConcurrentNavigableMap.class || rawType == ConcurrentSkipListMap.class) {
            return ConcurrentSkipListMap.class;
        } else if (rawType == List.class || rawType == AbstractList.class || rawType == ArrayList.class
                || rawType == Collection.class) {
            return ArrayList.class;
        } else if (rawType == AbstractSequentialList.class || rawType == LinkedList.class) {
            return LinkedList.class;
        } else if (rawType == Set.class || rawType == AbstractSet.class || rawType == HashSet.class) {
            return HashSet.class;
        } else if (rawType == SortedSet.class || rawType == TreeSet.class) {
            return TreeSet.class;
        } else if (rawType == Queue.class || rawType == AbstractQueue.class || rawType == Deque.class
                || rawType == ArrayDeque.class) {
            return ArrayDeque.class;
        } else if (rawType == BlockingQueue.class || rawType == LinkedBlockingQueue.class) {
            return LinkedBlockingQueue.class;
        } else if (rawType == BlockingDeque.class || rawType == LinkedBlockingDeque.class) {
            return LinkedBlockingDeque.class;
        } else if (rawType == TransferQueue.class || rawType == LinkedTransferQueue.class) {
            return LinkedTransferQueue.class;
        } else {
            return returnNullIfNotMapOrCollection ? null : rawType;
        }
    }
1014519
public function supportsType(Transaction\TransactionType $type = null)
    {
        return in_array((null === $type ? null : $type->getValue()), static::$supportedTypes);
    }
903162
private boolean supportsConnects(String serviceType) {
        return !serviceType.equals("jms") &&
                !serviceType.equals("echo") &&
                !serviceType.equals("management.jmx") &&
                !serviceType.equals("$management.jmx$") &&
                !serviceType.equals("management.snmp") &&
                !serviceType.equals("$management.snmp$") &&
                !serviceType.equals("directory");
    }
723183
public static boolean
supportedType(int type) {
	Type.check(type);
	return (type == Type.PTR || type == Type.CNAME || type == Type.DNAME ||
		type == Type.A || type == Type.AAAA || type == Type.NS);
}
871532
public <T> List<List<T>> queryTypedResults(String sql, String[] args) {
		@SuppressWarnings("unchecked")
		List<List<T>> result = (List<List<T>>) (Object) queryResults(sql, args);
		return result;
	}
1324438
def is_sqlatype_numeric(coltype: Union[TypeEngine, VisitableType]) -> bool:
    
    coltype = _coltype_to_typeengine(coltype)
    return isinstance(coltype, sqltypes.Numeric)
120197
@SuppressWarnings("unchecked")
  public boolean result(final Object iRecord) {
    final ODocument record = (ODocument) iRecord;

    boolean recordUpdated = false;

    parameters.reset();

    // BIND VALUES TO UPDATE
    if (!setEntries.isEmpty()) {
      OSQLHelper.bindParameters(record, setEntries, parameters);
      recordUpdated = true;
    }

    // BIND VALUES TO INCREMENT
    for (Map.Entry<String, Number> entry : incrementEntries.entrySet()) {
      final Number prevValue = record.field(entry.getKey());

      if (prevValue == null)
        // NO PREVIOUS VALUE: CONSIDER AS 0
        record.field(entry.getKey(), entry.getValue());
      else
        // COMPUTING INCREMENT
        record.field(entry.getKey(), OType.increment(prevValue, entry.getValue()));

      recordUpdated = true;
    }

    Object v;

    // BIND VALUES TO ADD
    Collection<Object> coll;
    Object fieldValue;
    for (OPair<String, Object> entry : addEntries) {
      coll = null;
      if (!record.containsField(entry.getKey())) {
        // GET THE TYPE IF ANY
        if (record.getSchemaClass() != null) {
          OProperty prop = record.getSchemaClass().getProperty(entry.getKey());
          if (prop != null && prop.getType() == OType.LINKSET)
            // SET TYPE
            coll = new HashSet<Object>();
        }

        if (coll == null)
          // IN ALL OTHER CASES USE A LIST
          coll = new ArrayList<Object>();

        record.field(entry.getKey(), coll);
      } else {
        fieldValue = record.field(entry.getKey());

        if (fieldValue instanceof Collection<?>)
          coll = (Collection<Object>) fieldValue;
        else
          continue;
      }

      v = entry.getValue();

      if (v instanceof OSQLFilterItem)
        v = ((OSQLFilterItem) v).getValue(record, context);
      else if (v instanceof OSQLFunctionRuntime)
        v = ((OSQLFunctionRuntime) v).execute(record, this);

      coll.add(v);
      recordUpdated = true;
    }

    // BIND VALUES TO PUT (AS MAP)
    Map<String, Object> map;
    OPair<String, Object> pair;
    for (Entry<String, OPair<String, Object>> entry : putEntries.entrySet()) {
      fieldValue = record.field(entry.getKey());

      if (fieldValue == null) {
        if (record.getSchemaClass() != null) {
          final OProperty property = record.getSchemaClass().getProperty(entry.getKey());
          if (property != null
              && (property.getType() != null && (!property.getType().equals(OType.EMBEDDEDMAP) && !property.getType().equals(
                  OType.LINKMAP)))) {
            throw new OCommandExecutionException("field " + entry.getKey() + " is not defined as a map");
          }
        }
        fieldValue = new HashMap<String, Object>();
        record.field(entry.getKey(), fieldValue);
      }

      if (fieldValue instanceof Map<?, ?>) {
        map = (Map<String, Object>) fieldValue;

        pair = entry.getValue();

        if (pair.getValue() instanceof OSQLFilterItem)
          pair.setValue(((OSQLFilterItem) pair.getValue()).getValue(record, null));
        else if (pair.getValue() instanceof OSQLFunctionRuntime)
          v = ((OSQLFunctionRuntime) pair.getValue()).execute(record, this);

        map.put(pair.getKey(), pair.getValue());
        recordUpdated = true;
      }
    }

    // REMOVE FIELD IF ANY
    for (OPair<String, Object> entry : removeEntries) {
      v = entry.getValue();
      if (v == EMPTY_VALUE) {
        record.removeField(entry.getKey());
        recordUpdated = true;
      } else {
        fieldValue = record.field(entry.getKey());

        if (fieldValue instanceof Collection<?>) {
          coll = (Collection<Object>) fieldValue;
          if (coll.remove(v))
            recordUpdated = true;
        } else if (fieldValue instanceof Map<?, ?>) {
          map = (Map<String, Object>) fieldValue;
          if (map.remove(v) != null)
            recordUpdated = true;
        }
      }
    }

    if (recordUpdated) {
      record.setDirty();
      record.save();
      recordCount++;
    }

    return true;
  }
196121
private IEntityLock instanceFromResultSet(java.sql.ResultSet rs)
            throws SQLException, LockingException {
        Integer entityTypeID = rs.getInt(1);
        Class entityType = EntityTypesLocator.getEntityTypes().getEntityTypeFromID(entityTypeID);
        String key = rs.getString(2);
        int lockType = rs.getInt(3);
        Timestamp ts = rs.getTimestamp(4);
        String lockOwner = rs.getString(5);

        return newInstance(entityType, key, lockType, ts, lockOwner);
    }
766434
public ResultSet getResultSet(int iType)
    {
        switch (iType)
        {
            case DBConstants.SQL_SEEK_TYPE:
                if (!SHARE_STATEMENTS)
                    return m_seekResultSet;
            case DBConstants.SQL_SELECT_TYPE:
            case DBConstants.SQL_CREATE_TYPE:
                return m_selectResultSet;
            case DBConstants.SQL_AUTOSEQUENCE_TYPE:
                return m_autoSequenceResultSet;
            case DBConstants.SQL_UPDATE_TYPE:
            case DBConstants.SQL_INSERT_TABLE_TYPE:
            case DBConstants.SQL_DELETE_TYPE:
            default:  // Never
                break;
        }
        return null;
    }
137146
public PreparedStatement prepareStatement(final String sql, 
                                              final int resultSetType, 
                                              final int resultSetConcurrency, 
                                              final int resultSetHoldability)
        throws SQLException {

        if (resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT) {
            throw new SQLFeatureNotSupportedException("Unsupported result set holdability");
        } // end of if

        return prepareStatement(sql, resultSetType, resultSetConcurrency);
    }
155609
public static boolean isTCLUnsafe(final DatabaseType databaseType, final TokenType tokenType, final LexerEngine lexerEngine) {
        if (DefaultKeyword.SET.equals(tokenType) || DatabaseType.SQLServer.equals(databaseType) && DefaultKeyword.IF.equals(tokenType)) {
            lexerEngine.skipUntil(DefaultKeyword.TRANSACTION, DefaultKeyword.AUTOCOMMIT, DefaultKeyword.IMPLICIT_TRANSACTIONS);
            if (!lexerEngine.isEnd()) {
                return true;
            }
        }
        return false;
    }
1044547
public static <T> boolean verifyAllSuccessful(List<Either<T, ExecutionException>> results) {
    return Iterables.all(results, new Predicate<Either<T, ExecutionException>>() {
      @Override
      public boolean apply(@Nullable Either<T, ExecutionException> input) {
        return input instanceof Either.Left;
      }
    });
  }
911620
boolean getMoreResults(int current) throws SQLException {
        checkClosed();

        if (resultIn == null || !resultIn.isData()) {
            return false;
        }

        if (resultSetCounter == 0) {
            resultSetCounter++;
            return true;
        }

        if (currentResultSet != null && current != KEEP_CURRENT_RESULT) {
            currentResultSet.close();
        }

        resultIn = null;

        return false;
    }
401132
public static boolean isODataEntityCollectionType(Class<?> type,
            Type genericType) {
        if (ListResult.class != type) {
            return false;
        }

        ParameterizedType pt = (ParameterizedType) genericType;

        if (pt.getActualTypeArguments().length != 1) {
            return false;
        }

        Class<?> typeClass = getCollectedType(genericType);

        return isODataEntityType(typeClass);
    }