row[7] = (procedureType == 0) ? new Short((short)procedureNoResult) : new Short((short)procedureReturnsResult);
row[7] = (procedureType == 0) ? XSQLVAR.encodeShort((short)procedureNoResult) : XSQLVAR.encodeShort((short)procedureReturnsResult);
    public ResultSet getProcedures(String catalog, String schemaPattern,            String procedureNamePattern) throws SQLException {        checkCatalogAndSchema(catalog, schemaPattern);        Clause procedureClause = new Clause("RDB$PROCEDURE_NAME", procedureNamePattern);        String sql = GET_PROCEDURES_START;        sql += procedureClause.getCondition();        sql += GET_PROCEDURES_END;        ArrayList params = new ArrayList();        if (!procedureClause.getCondition().equals("")) {            params.add(procedureClause.getValue());        }        ResultSet rs = c.doQuery(sql, params, statements);        XSQLVAR[] xsqlvars = new XSQLVAR[8];        xsqlvars[0] = new XSQLVAR();        xsqlvars[0].sqltype = GDS.SQL_VARYING;        xsqlvars[0].sqllen = 31;        xsqlvars[0].sqlname = "PROCEDURE_CAT";        xsqlvars[0].relname = "RDB$PROCEDURES";        xsqlvars[1] = new XSQLVAR();        xsqlvars[1].sqltype = GDS.SQL_VARYING;        xsqlvars[1].sqllen = 31;        xsqlvars[1].sqlname = "PROCEDURE_SCHEM";        xsqlvars[1].relname = "RDB$PROCEDURES";        xsqlvars[2] = new XSQLVAR();        xsqlvars[2].sqltype = GDS.SQL_VARYING;        xsqlvars[2].sqllen = 31;        xsqlvars[2].sqlname = "PROCEDURE_NAME";        xsqlvars[2].relname = "RDB$PROCEDURES";        xsqlvars[3] = new XSQLVAR();        xsqlvars[3].sqltype = GDS.SQL_VARYING;        xsqlvars[3].sqllen = 31;        xsqlvars[3].sqlname = "FUTURE1";        xsqlvars[3].relname = "RDB$PROCEDURES";        xsqlvars[4] = new XSQLVAR();        xsqlvars[4].sqltype = GDS.SQL_VARYING;        xsqlvars[4].sqllen = 31;        xsqlvars[4].sqlname = "FUTURE2";        xsqlvars[4].relname = "RDB$PROCEDURES";        xsqlvars[5] = new XSQLVAR();        xsqlvars[5].sqltype = GDS.SQL_VARYING;        xsqlvars[5].sqllen = 31;        xsqlvars[5].sqlname = "FUTURE3";        xsqlvars[5].relname = "RDB$PROCEDURES";        xsqlvars[6] = new XSQLVAR();        xsqlvars[6].sqltype = GDS.SQL_VARYING;        xsqlvars[6].sqllen = 80; // gets updated if there are longer remarks.        xsqlvars[6].sqlname = "REMARKS";        xsqlvars[6].relname = "RDB$PROCEDURES";        xsqlvars[7] = new XSQLVAR();        xsqlvars[7].sqltype = GDS.SQL_SHORT;        xsqlvars[7].sqlname = "PROCEDURE_TYPE";        xsqlvars[7].relname = "RDB$PROCEDURES";	// re-arrange data to match JDBC 2.0 spec        ArrayList rows = new ArrayList();        while (rs.next()) {            Object[] row = new Object[8];            row[0] = null;            row[1] = null;            row[2] = getBytes(rs.getString("PROCEDURE_NAME").trim());            row[3] = null;            row[4] = null;            row[5] = null;            String remarks = rs.getString("REMARKS");            row[6] = getBytes(remarks);            if (remarks != null && remarks.length() > xsqlvars[6].sqllen)                xsqlvars[6].sqllen = remarks.length();            short procedureType = rs.getShort("PROCEDURE_TYPE");            row[7] = (procedureType == 0) ? new Short((short)procedureNoResult) : new Short((short)procedureReturnsResult);            rows.add(row);        }        return new FBResultSet(xsqlvars, rows);    }