for(int i = 0; i < argTypes.size(); i++)
for(int i = 0; i < argTypes.length; i++)
	public java.sql.ResultSet getProcedureColumns(String catalog,		String schemaPattern, String procedureNamePattern,		String columnNamePattern) throws SQLException	{		ResultSetField f[] = new ResultSetField[13];		ArrayList v = new ArrayList(); // The new ResultSet tuple stuff		f[0] = new ResultSetField("PROCEDURE_CAT", TypeOid.VARCHAR,			getMaxNameLength());		f[1] = new ResultSetField("PROCEDURE_SCHEM", TypeOid.VARCHAR,			getMaxNameLength());		f[2] = new ResultSetField("PROCEDURE_NAME", TypeOid.VARCHAR,			getMaxNameLength());		f[3] = new ResultSetField("COLUMN_NAME", TypeOid.VARCHAR,			getMaxNameLength());		f[4] = new ResultSetField("COLUMN_TYPE", TypeOid.INT2, 2);		f[5] = new ResultSetField("DATA_TYPE", TypeOid.INT2, 2);		f[6] = new ResultSetField("TYPE_NAME", TypeOid.VARCHAR,			getMaxNameLength());		f[7] = new ResultSetField("PRECISION", TypeOid.INT4, 4);		f[8] = new ResultSetField("LENGTH", TypeOid.INT4, 4);		f[9] = new ResultSetField("SCALE", TypeOid.INT2, 2);		f[10] = new ResultSetField("RADIX", TypeOid.INT2, 2);		f[11] = new ResultSetField("NULLABLE", TypeOid.INT2, 2);		f[12] = new ResultSetField("REMARKS", TypeOid.VARCHAR,			getMaxNameLength());		String sql = "SELECT n.nspname,p.proname,p.prorettype,p.proargtypes, t.typtype::varchar,t.typrelid "				+ " FROM pg_catalog.pg_proc p,pg_catalog.pg_namespace n, pg_catalog.pg_type t "				+ " WHERE p.pronamespace=n.oid AND p.prorettype=t.oid "                + " AND " + resolveSchemaPatternCondition(                                "n.nspname", schemaPattern);		if(procedureNamePattern != null)		{			sql += " AND p.proname LIKE '"				+ escapeQuotes(procedureNamePattern) + "' ";		}		sql += " ORDER BY n.nspname, p.proname ";		ResultSet rs = m_connection.createStatement().executeQuery(sql);		String schema = null;		String procedureName = null;		Oid returnType = null;		String returnTypeType = null;		Oid returnTypeRelid = null;		String strArgTypes = null;		StringTokenizer st = null;		ArrayList argTypes = null;		while(rs.next())		{			schema = rs.getString("nspname");			procedureName = rs.getString("proname");			returnType = (Oid)rs.getObject("prorettype");			returnTypeType = rs.getString("typtype");			returnTypeRelid = (Oid)rs.getObject("typrelid");			strArgTypes = rs.getString("proargtypes");			//argTypesArr = rs.getArray("proargtypes");			//ResultSet argrs = argTypesArr.getResultSet();			st = new StringTokenizer(strArgTypes);			argTypes = new ArrayList();			while(st.hasMoreTokens())			{				argTypes.add(new Oid(Integer.parseInt(st.nextToken())));			}			// decide if we are returning a single column result.			if(!returnTypeType.equals("c"))			{				Object[] tuple = new Object[13];				tuple[0] = null;				tuple[1] = schema;				tuple[2] = procedureName;				tuple[3] = "returnValue";				tuple[4] = new Short((short)java.sql.DatabaseMetaData.procedureColumnReturn);				tuple[5] = new Short((short)m_connection.getSQLType(returnType));				tuple[6] = m_connection.getPGType(returnType);				tuple[7] = null;				tuple[8] = null;				tuple[9] = null;				tuple[10] = null;				tuple[11] = new Short((short)java.sql.DatabaseMetaData.procedureNullableUnknown);				tuple[12] = null;				v.add(tuple);			}			// Add a row for each argument.			for(int i = 0; i < argTypes.size(); i++)			{				Oid argOid = (Oid)argTypes.get(i);				Object[] tuple = new Object[13];				tuple[0] = null;				tuple[1] = schema;				tuple[2] = procedureName;				tuple[3] = "$" + (i + 1);				tuple[4] = new Short((short)java.sql.DatabaseMetaData.procedureColumnIn);				tuple[5] = new Short((short)m_connection.getSQLType(argOid));				tuple[6] = m_connection.getPGType(argOid);				tuple[7] = null;				tuple[8] = null;				tuple[9] = null;				tuple[10] = null;				tuple[11] = new Short((short)java.sql.DatabaseMetaData.procedureNullableUnknown);				tuple[12] = null;				v.add(tuple);			}			// if we are returning a multi-column result.			if(returnTypeType.equals("c"))			{				String columnsql = "SELECT a.attname,a.atttypid FROM pg_catalog.pg_attribute a WHERE a.attrelid = ? ORDER BY a.attnum ";				PreparedStatement stmt = m_connection.prepareStatement(columnsql);				stmt.setObject(1, returnTypeRelid);				ResultSet columnrs = stmt.executeQuery(columnsql);				while(columnrs.next())				{					Oid columnTypeOid = (Oid)columnrs.getObject("atttypid");					Object[] tuple = new Object[13];					tuple[0] = null;					tuple[1] = schema;					tuple[2] = procedureName;					tuple[3] = columnrs.getString("attname");					tuple[4] = new Short((short)java.sql.DatabaseMetaData.procedureColumnResult);					tuple[5] = new Short((short)m_connection.getSQLType(columnTypeOid));					tuple[6] = m_connection.getPGType(columnTypeOid);					tuple[7] = null;					tuple[8] = null;					tuple[9] = null;					tuple[10] = null;					tuple[11] = new Short((short)java.sql.DatabaseMetaData.procedureNullableUnknown);					tuple[12] = null;					v.add(tuple);				}				columnrs.close();				stmt.close();			}		}		rs.close();		return createSyntheticResultSet(f, v);	}