code: protected boolean executeOneCompleteStmt(final String _complStmt)
          throws EFapsException
      {
          final boolean ret = false;
          ConnectionResource con = null;
          try {
              con = Context.getThreadContext().getConnectionResource();
  
              AbstractObjectQuery.LOG.debug("Executing SQL: {}", _complStmt);
  
              final Statement stmt = con.createStatement();
  
              final ResultSet rs = stmt.executeQuery(_complStmt.toString());
              final List<Object[]> values = new ArrayList<>();
              while (rs.next()) {
                  final long id = rs.getLong(1);
                  Long typeId = null;
                  if (getBaseType().getMainTable().getSqlColType() != null) {
                      typeId = rs.getLong(2);
                  }
                  values.add(new Object[]{id, typeId});
              }
              rs.close();
              stmt.close();
              for (final Object[] row: values) {
                  final Long id = (Long) row[0];
                  final Long typeId = (Long) row[1];
                  getValues().add(Instance.get(typeId == null ? getBaseType() : Type.get(typeId), id));
              }
          } catch (final SQLException e) {
              throw new EFapsException(InstanceQuery.class, "executeOneCompleteStmt", e);
          }
          return ret;
      }
docs: Execute the actual statement against the database.
  @param _complStmt        Statment to be executed
  @return true if executed with success
  @throws EFapsException on error