You can do a DB query for sure but you might be able to query VCD via the System Org. Not sure if there's an API to directly do it. You might have to get all vApps and their IP's and then sort them.
Does it matter what you use to get them (direct to DB, PoerCLI, VCO, API, etc..)?
Eric