Display the java.sql.ResultSet result set type constant corresponding to the value
supplied.

@param level a valid java.sql.ResultSet result set type constant.

@return the name of the constant, or a string indicating the constant is unknown.
165642
public static String getResultSetTypeString(int type) {
        switch (type) {
            case ResultSet.TYPE_FORWARD_ONLY:
                return "TYPE FORWARD ONLY (" + type + ')'; 

            case ResultSet.TYPE_SCROLL_INSENSITIVE:
                return "TYPE SCROLL INSENSITIVE (" + type + ')'; 

            case ResultSet.TYPE_SCROLL_SENSITIVE:
                return "TYPE SCROLL SENSITIVE (" + type + ')'; 

            case TYPE_SS_SCROLL_DYNAMIC: 
                return "TYPE SS SCROLL DYNAMIC (" + type + ')'; 

            case TYPE_SS_DIRECT_FORWARD_ONLY: 
                return "TYPE SS DIRECT FORWARD ONLY (" + type + ')'; 

            case TYPE_SS_SERVER_CURSOR_FORWARD_ONLY: 
                return "TYPE SS SERVER CURSOR FORWARD ONLY (" + type + ')'; 
        }

        return "UNKNOWN RESULT SET TYPE CONSTANT (" + type + ')'; 
    }
1281934
public static List<String> getFieldNames(ResultSetMetaData  resultSetMetaData) throws SQLException {
        List<String> columnNames = new ArrayList<>();
        int cols = resultSetMetaData.getColumnCount();
        for (int i = 1; i <= cols; i++) {
            columnNames.add(resultSetMetaData.getColumnName(i));
        }
        return columnNames;
    }
844322
@Override
    public ResultSet getTypeInfo() throws SQLException
    {
        checkClosed();
        this.sysCatalog.setString(1, "TYPEINFO");
        ResultSet res = this.sysCatalog.executeQuery();
        return res;
    }
1096337
public Integer getIdFromName(String profileName) {
        PreparedStatement query = null;
        ResultSet results = null;

        try (Connection sqlConnection = sqlService.getConnection()) {
            query = sqlConnection.prepareStatement("SELECT * FROM " + Constants.DB_TABLE_PROFILE +
                                                       " WHERE " + Constants.PROFILE_PROFILE_NAME + " = ?");
            query.setString(1, profileName);
            results = query.executeQuery();
            if (results.next()) {
                Object toReturn = results.getObject(Constants.GENERIC_ID);
                query.close();
                return (Integer) toReturn;
            }
            query.close();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                if (results != null) {
                    results.close();
                }
            } catch (Exception e) {
            }
            try {
                if (query != null) {
                    query.close();
                }
            } catch (Exception e) {
            }
        }
        return null;
    }
781417
private static String getColumnName(ResultSetMetaData metaData, int idx, EColumnNameCase nameCase) throws SQLException {
		String colName = metaData.getColumnName(idx);
		switch (nameCase) {
			case LOWER:
				colName = colName.toLowerCase();
				break;
			case UPPER:
				colName = colName.toUpperCase();
				break;
		}

		return colName;
	}
48799
public int getIsolationLevel() {
        final Optional<IsolationLevel> e = Enums.getIfPresent(IsolationLevel.class, getProperty(ISOLATION_LEVEL).toUpperCase());

        if (!e.isPresent()) {
            throw new DatabaseEngineRuntimeException(ISOLATION_LEVEL + " must be set and be one of the following: " + EnumSet.allOf(IsolationLevel.class));
        }

        switch (e.get()) {
            case READ_UNCOMMITTED:
                return Connection.TRANSACTION_READ_UNCOMMITTED;
            case READ_COMMITTED:
                return Connection.TRANSACTION_READ_COMMITTED;
            case REPEATABLE_READ:
                return Connection.TRANSACTION_REPEATABLE_READ;
            case SERIALIZABLE:
                return Connection.TRANSACTION_SERIALIZABLE;
            default:
                // Never happens.
                throw new DatabaseEngineRuntimeException("New isolation level?!" + e.get());
        }
    }
107432
private void formatResultSet(ResultSet r) {

        if (r == null) {
            String[] g = new String[1];

            g[0] = "Result";

            gResult.setHead(g);

            g[0] = "(empty)";

            gResult.addRow(g);

            return;
        }

        try {
            ResultSetMetaData m         = r.getMetaData();
            int               col       = m.getColumnCount();
            Object[]          h         = new Object[col];
            boolean[]         isVarChar = new boolean[col];

            for (int i = 1; i <= col; i++) {
                h[i - 1] = m.getColumnLabel(i);
                isVarChar[i - 1] = (m.getColumnType(i)
                                    == java.sql.Types.VARCHAR);
            }

            gResult.setHead(h);

            while (r.next()) {
                for (int i = 1; i <= col; i++) {
                    try {
                        h[i - 1] = r.getObject(i);

                        if (r.wasNull()) {
                            h[i - 1] = (isVarChar[i - 1] ? NULL_STR
                                                         : null);
                        }
                    } catch (SQLException e) {}
                }

                gResult.addRow(h);
            }

            r.close();
        } catch (SQLException e) {

            //  Added: (weconsultants@users)
            CommonSwing.errorMessage(e);
        }
    }
100275
private String getSignatureFromNameAndType(int index) throws InvalidClassFileFormatException {
        checkConstantPoolIndex(index);
        Constant constant = constantPool[index];
        checkConstantTag(constant, IClassConstants.CONSTANT_NameAndType);
        return getUtf8String((Integer) constant.data[1]);
    }
1001710
LevelDBTypeInfo getTypeInfo(Class<?> type) throws Exception {
    LevelDBTypeInfo ti = types.get(type);
    if (ti == null) {
      LevelDBTypeInfo tmp = new LevelDBTypeInfo(this, type, getTypeAlias(type));
      ti = types.putIfAbsent(type, tmp);
      if (ti == null) {
        ti = tmp;
      }
    }
    return ti;
  }
641282
public String query(String query) {
        try {
            Connection conn = this.tx().getConnection();
            ObjectNode result = this.mapper.createObjectNode();
            ArrayNode dataNode = this.mapper.createArrayNode();
            ArrayNode metaNode = this.mapper.createArrayNode();
            Statement statement = conn.createStatement();
            if (logger.isDebugEnabled()) {
                logger.debug(query);
            }
            ResultSet rs = statement.executeQuery(query);
            ResultSetMetaData rsmd = rs.getMetaData();
            boolean first = true;
            while (rs.next()) {
                int numColumns = rsmd.getColumnCount();
                ObjectNode obj = this.mapper.createObjectNode();
                for (int i = 1; i < numColumns + 1; i++) {
                    String columnName = rsmd.getColumnLabel(i);
                    int type = rsmd.getColumnType(i);
                    //make sure to obtain array using getArray()
                    //At least in H2, this makes a difference...
                    Object o = type == Types.ARRAY ? rs.getArray(i) : rs.getObject(i);
                    this.sqlDialect.putJsonObject(obj, columnName, type, o);
                    if (first) {
                        this.sqlDialect.putJsonMetaObject(this.mapper, metaNode, columnName, type, o);
                    }
                }
                first = false;
                dataNode.add(obj);
            }
            result.set("data", dataNode);
            result.set("meta", metaNode);
            return result.toString();
        } catch (SQLException e) {
            throw new RuntimeException(e);
        } finally {
            this.tx().rollback();
        }
    }
332549
public int getSqlType(Object o) {
        if (null == o) {
            return Types.NULL;
        }
        return getSqlType(o.getClass());
    }
942487
private String getPropertyValue(String level, String name)
    {
        return getDefForLevel(level).getProperty(name);
    }
1124134
protected int count(UserCustomResultSet resultSet) {
		int count = 0;
		try {
			count = resultSet.getCount();
		} finally {
			resultSet.close();
		}
		return count;
	}
203672
@Override
    @Nullable
    public Constant getConstant(int column) throws OntopResultConversionException {
        final MainTypeLangValues cell = row.get(column - 1);
        if (cell.getMainValue() == null) {
            return null;
        } else {
            return constantRetriever.getConstantFromJDBC(cell);
        }
    }
777157
public static Object getValue(final ResultSet resultSet, final int columnIndex) throws SQLException {
        Object result = getValueByColumnType(resultSet, columnIndex);
        return resultSet.wasNull() ? null : result;
    }
143592
protected final void useResultSet( ResultSet pResultSet ) throws SQLException
  {
    boolean lFirst = true;

    if( !pResultSet.next() )
    {
      handleEmptyResultSet();
    }
    else
    {
      while( lFirst || pResultSet.next() )
      {
        lFirst = false;

        useResultSetRow( pResultSet );
      }
    }
  }
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;
    }