crossReferencesRs = metaData.getCrossReference( null,
try {crossReferencesRs = metaData.getCrossReference( null,
	public ArrayList getCrossReferences( String primarySchema,			String primaryTable, String foreignSchema, String foreignTable )	{		if ( metaData == null )		{			return null;		}		String fullPrimaryTableName = primaryTable;		String fullForeignTableName = foreignTable;		if ( primarySchema != null )		{			fullPrimaryTableName = primarySchema + "." + fullPrimaryTableName;		}		if ( foreignSchema != null )		{			fullForeignTableName = foreignSchema + "." + fullForeignTableName;		}		// If already retrieved then, get it from the Hash		ArrayList crossReferences = (ArrayList) crossReferenceMap.get( fullForeignTableName );		if ( crossReferences != null )		{			return crossReferences;		}		else		{			crossReferences = new ArrayList( );		}		ResultSet crossReferencesRs = null;		try		{			crossReferencesRs = metaData.getCrossReference( null,					primarySchema,					primaryTable,					null,					foreignSchema,					foreignTable );			// test			// crossReferencesRs = metaData.getCrossReference(null,			// primarySchema, "customers", null, foreignSchema, "orders");			while ( crossReferencesRs.next( ) )			{				String pkSchema = crossReferencesRs.getString( "PKTABLE_SCHEM" );				String pkTable = crossReferencesRs.getString( "PKTABLE_NAME" );				String pkColumn = crossReferencesRs.getString( "PKCOLUMN_NAME" );				String fkSchema = crossReferencesRs.getString( "FKTABLE_SCHEM" );				String fkTable = crossReferencesRs.getString( "FKTABLE_NAME" );				String fkColumn = crossReferencesRs.getString( "FKCOLUMN_NAME" );				String pkFullColumnName = pkTable + "." + pkColumn;				String fkFullColumnName = fkTable + "." + fkColumn;				if ( pkSchema != null && pkSchema.length( ) > 0 )				{					pkFullColumnName = pkSchema + "." + pkFullColumnName;				}				if ( fkSchema != null && fkSchema.length( ) > 0 )				{					fkFullColumnName = fkSchema + "." + fkFullColumnName;				}				CrossReference crossReference = new CrossReference( pkSchema,						pkTable,						pkColumn,						fkSchema,						fkTable,						fkColumn );				crossReferences.add( crossReference );			}			if ( crossReferences != null && crossReferences.size( ) > 0 )			{				crossReferenceMap.put( fullPrimaryTableName, crossReferences );			}		}		catch ( SQLException e )		{			// TODO Auto-generated catch block			//e.printStackTrace();		}		return crossReferences;	}