I'd say use the dm_exec_query_stats. I believe there is a DBID in there. The plan cache is transcient, so commands may get removed from the cache and not all statements are cached at all.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability