From Java code you can query the Hive Metastore directly - cf. JavaDoc
Or, if you like quick-and-dirty tricks, you can connect to the Metastore database (typically a MySQL instance) and run some SQL queries directly against it. Not much public documentation about the data model, unfortunately.