Short shortZero = new Short((short)0);
byte[] shortZero = XSQLVAR.encodeShort((short)0);
    public  ResultSet getTypeInfo() throws SQLException {        Short shortZero = new Short((short)0);        byte[] CASESENSITIVE = getBytes("T");        byte[] CASEINSENSITIVE = getBytes("F");        byte[] UNSIGNED = getBytes("T");        byte[] SIGNED = getBytes("F");        byte[] FIXEDSCALE = getBytes("T");        byte[] VARIABLESCALE = getBytes("F");        byte[] NOTAUTOINC = getBytes("F");        Integer BINARY = new Integer(2);        Short PREDNONE = new Short((short) DatabaseMetaData.typePredNone);        Short PREDBASIC = new Short((short) DatabaseMetaData.typePredBasic);        Short SEARCHABLE = new Short((short) DatabaseMetaData.typeSearchable);        Short NULLABLE = new Short((short) DatabaseMetaData.typeNullable);        //need to construct xsqlvar[] for ResultSetMetaData.        XSQLVAR[] xsqlvars = new XSQLVAR[18];        xsqlvars[0] = new XSQLVAR();        xsqlvars[0].sqltype = GDS.SQL_VARYING;        xsqlvars[0].sqllen = 31;        xsqlvars[0].sqlname = "TYPE_NAME";        xsqlvars[0].relname = "TYPEINFO";        xsqlvars[1] = new XSQLVAR();        xsqlvars[1].sqltype = GDS.SQL_SHORT;        xsqlvars[1].sqlname = "DATA_TYPE";        xsqlvars[1].relname = "TYPEINFO";        xsqlvars[2] = new XSQLVAR();        xsqlvars[2].sqltype = GDS.SQL_LONG;        xsqlvars[2].sqlname = "PRECISION";        xsqlvars[2].relname = "TYPEINFO";        xsqlvars[3] = new XSQLVAR();        xsqlvars[3].sqltype = GDS.SQL_VARYING;        xsqlvars[3].sqllen = 1;        xsqlvars[3].sqlname = "LITERAL_PREFIX";        xsqlvars[3].relname = "TYPEINFO";        xsqlvars[4] = new XSQLVAR();        xsqlvars[4].sqltype = GDS.SQL_VARYING;        xsqlvars[4].sqllen = 1;        xsqlvars[4].sqlname = "LITERAL_SUFFIX";        xsqlvars[4].relname = "TYPEINFO";        xsqlvars[5] = new XSQLVAR();        xsqlvars[5].sqltype = GDS.SQL_VARYING;        xsqlvars[5].sqllen = 31;        xsqlvars[5].sqlname = "CREATE_PARAMS";        xsqlvars[5].relname = "TYPEINFO";        xsqlvars[6] = new XSQLVAR();        xsqlvars[6].sqltype = GDS.SQL_SHORT;        xsqlvars[6].sqlname = "NULLABLE";        xsqlvars[6].relname = "TYPEINFO";        xsqlvars[7] = new XSQLVAR();        xsqlvars[7].sqltype = GDS.SQL_TEXT;        xsqlvars[7].sqllen = 1;        xsqlvars[7].sqlname = "CASE_SENSITIVE";        xsqlvars[7].relname = "TYPEINFO";        xsqlvars[8] = new XSQLVAR();        xsqlvars[8].sqltype = GDS.SQL_SHORT;        xsqlvars[8].sqlname = "SEARCHABLE";        xsqlvars[8].relname = "TYPEINFO";        xsqlvars[9] = new XSQLVAR();        xsqlvars[9].sqltype = GDS.SQL_TEXT;        xsqlvars[9].sqllen = 1;        xsqlvars[9].sqlname = "UNSIGNED_ATTRIBUTE";        xsqlvars[9].relname = "TYPEINFO";        xsqlvars[10] = new XSQLVAR();        xsqlvars[10].sqltype = GDS.SQL_TEXT;        xsqlvars[10].sqllen = 1;        xsqlvars[10].sqlname = "FIXED_PREC_SCALE";        xsqlvars[10].relname = "TYPEINFO";        xsqlvars[11] = new XSQLVAR();        xsqlvars[11].sqltype = GDS.SQL_TEXT;        xsqlvars[11].sqllen = 1;        xsqlvars[11].sqlname = "AUTO_INCREMENT";        xsqlvars[11].relname = "TYPEINFO";        xsqlvars[12] = new XSQLVAR();        xsqlvars[12].sqltype = GDS.SQL_VARYING;        xsqlvars[12].sqllen = 31;        xsqlvars[12].sqlname = "LOCAL_TYPE_NAME";        xsqlvars[12].relname = "TYPEINFO";        xsqlvars[13] = new XSQLVAR();        xsqlvars[13].sqltype = GDS.SQL_SHORT;        xsqlvars[13].sqlname = "MINIMUM_SCALE";        xsqlvars[13].relname = "TYPEINFO";        xsqlvars[14] = new XSQLVAR();        xsqlvars[14].sqltype = GDS.SQL_SHORT;        xsqlvars[14].sqlname = "MAXIMUM_SCALE";        xsqlvars[14].relname = "TYPEINFO";        xsqlvars[15] = new XSQLVAR();        xsqlvars[15].sqltype = GDS.SQL_LONG;        xsqlvars[15].sqlname = "SQL_DATA_TYPE";        xsqlvars[15].relname = "TYPEINFO";        xsqlvars[16] = new XSQLVAR();        xsqlvars[16].sqltype = GDS.SQL_LONG;        xsqlvars[16].sqlname = "SQL_DATETIME_SUB";        xsqlvars[16].relname = "TYPEINFO";        xsqlvars[17] = new XSQLVAR();        xsqlvars[17].sqltype = GDS.SQL_LONG;        xsqlvars[17].sqlname = "NUM_PREC_RADIX";        xsqlvars[17].relname = "TYPEINFO";        //dialect 3 only        ArrayList rows = new ArrayList();        rows.add(new Object[] {getBytes("CHAR"), createShort(Types.CHAR)            , new Integer(32664), getBytes("'"), getBytes("'"), getBytes("length"),            NULLABLE, CASESENSITIVE, SEARCHABLE, UNSIGNED, FIXEDSCALE,            NOTAUTOINC, null, shortZero, shortZero, new Integer(GDS.SQL_TEXT), null, BINARY});        rows.add(new Object[] {getBytes("NUMERIC"), createShort(Types.NUMERIC)            , new Integer(18), null, null, getBytes("precision,scale"),            NULLABLE, CASEINSENSITIVE, SEARCHABLE, SIGNED, FIXEDSCALE,            NOTAUTOINC, null, shortZero, createShort(18), new Integer(GDS.SQL_INT64), null, BINARY});        rows.add(new Object[] {getBytes("DECIMAL"), createShort(Types.DECIMAL)            , new Integer(18), null, null, getBytes("precision,scale"),            NULLABLE, CASEINSENSITIVE, SEARCHABLE, SIGNED, FIXEDSCALE,            NOTAUTOINC, null, shortZero, createShort(18), new Integer(GDS.SQL_INT64), null, BINARY});        rows.add(new Object[] {getBytes("INTEGER"), createShort(Types.INTEGER)            , new Integer(32), null, null, null,            NULLABLE, CASEINSENSITIVE, SEARCHABLE, SIGNED, FIXEDSCALE,            NOTAUTOINC, null, shortZero, shortZero, new Integer(GDS.SQL_LONG), null, BINARY});        rows.add(new Object[] {getBytes("SMALLINT"), createShort(Types.SMALLINT)            , new Integer(16), null, null, null,            NULLABLE, CASEINSENSITIVE, SEARCHABLE, SIGNED, FIXEDSCALE,            NOTAUTOINC, null, shortZero, shortZero, new Integer(GDS.SQL_SHORT), null, BINARY});        rows.add(new Object[] {getBytes("FLOAT"), createShort(Types.FLOAT)            , new Integer(7), null, null, null,            NULLABLE, CASEINSENSITIVE, SEARCHABLE, SIGNED, VARIABLESCALE,            NOTAUTOINC, null, createShort(0), createShort(7), new Integer(GDS.SQL_FLOAT), null, BINARY});        rows.add(new Object[] {getBytes("DOUBLE PRECISION"), createShort(Types.DOUBLE)            , new Integer(15), null, null, null,            NULLABLE, CASEINSENSITIVE, SEARCHABLE, SIGNED, VARIABLESCALE,            NOTAUTOINC, null, createShort(0), createShort(15), new Integer(GDS.SQL_DOUBLE), null, BINARY});        rows.add(new Object[] {getBytes("VARCHAR"), createShort(Types.VARCHAR)            , new Integer(32664), getBytes("'"), getBytes("'"), getBytes("length"),            NULLABLE, CASESENSITIVE, SEARCHABLE, UNSIGNED, FIXEDSCALE,            NOTAUTOINC, null, shortZero, shortZero, new Integer(GDS.SQL_VARYING), null, BINARY});        rows.add(new Object[] {getBytes("DATE"), createShort(Types.DATE)            , new Integer(0), null, null, null,            NULLABLE, CASEINSENSITIVE, SEARCHABLE, UNSIGNED, FIXEDSCALE,            NOTAUTOINC, null, shortZero, shortZero, new Integer(GDS.SQL_TYPE_DATE), null, BINARY});        rows.add(new Object[] {getBytes("TIME"), createShort(Types.TIME)            , new Integer(0), null, null, null,            NULLABLE, CASEINSENSITIVE, SEARCHABLE, UNSIGNED, FIXEDSCALE,            NOTAUTOINC, null, shortZero, shortZero, new Integer(GDS.SQL_TYPE_TIME), null, BINARY});        rows.add(new Object[] {getBytes("TIMESTAMP"), createShort(Types.TIMESTAMP)            , new Integer(0), null, null, null,            NULLABLE, CASEINSENSITIVE, SEARCHABLE, UNSIGNED, FIXEDSCALE,            NOTAUTOINC, null, shortZero, shortZero, new Integer(GDS.SQL_TIMESTAMP), null, BINARY});        rows.add(new Object[] {getBytes("BLOB SUB_TYPE <0 "), createShort(Types.BLOB)            , new Integer(0), null, null, null,            NULLABLE, CASESENSITIVE, PREDNONE, UNSIGNED, FIXEDSCALE,            NOTAUTOINC, null, shortZero, shortZero, new Integer(GDS.SQL_BLOB), null, BINARY});        rows.add(new Object[] {getBytes("BLOB SUB_TYPE 0"), createShort(Types.LONGVARBINARY)            , new Integer(0), null, null, null,            NULLABLE, CASESENSITIVE, PREDNONE, UNSIGNED, FIXEDSCALE,            NOTAUTOINC, null, shortZero, shortZero, new Integer(GDS.SQL_BLOB), null, BINARY});        rows.add(new Object[] {getBytes("BLOB SUB_TYPE 1"), createShort(Types.LONGVARCHAR)            , new Integer(0), null, null, null,            NULLABLE, CASESENSITIVE, PREDNONE, UNSIGNED, FIXEDSCALE,            NOTAUTOINC, null, shortZero, shortZero, new Integer(GDS.SQL_BLOB), null, BINARY});        rows.add(new Object[] {getBytes("BLOB SUB_TYPE >1"), createShort(Types.OTHER)            , new Integer(0), null, null, null,            NULLABLE, CASESENSITIVE, PREDNONE, UNSIGNED, FIXEDSCALE,            NOTAUTOINC, null, shortZero, shortZero, new Integer(GDS.SQL_BLOB), null, BINARY});        rows.add(new Object[] {getBytes("ARRAY"), createShort(Types.OTHER)            , new Integer(0), null, null, null,            NULLABLE, CASESENSITIVE, PREDNONE, UNSIGNED, FIXEDSCALE,            NOTAUTOINC, null, shortZero, shortZero, new Integer(GDS.SQL_ARRAY), null, BINARY});        return new FBResultSet(xsqlvars, rows);    }