• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getting list of table names in Oracle and MySQL

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear everyone,

I would like to ask "noob" question here regarding to Hibernate. I want to get a list of table names and list of columns names in every table from my database. I am using 2 different db environment (MySQL and Oracle) and I would like to do this for both.

Here are my files. I guess I'm wrong. Please guide me to get the results

hibernate.cfg.xml


TestScheme.java
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, this isn't really a Hibernate ORM thing. I mean you are trying to use Hibernate to get to that information, but the real issue is the databases and what "DBA" tables they have to get that information.

So, the only Hibernate thing would be that the connection/user has to have permission to access that stuff for each database.

But the big key is in the databases. In Oracle there is a table called dba_tables that you can query to get the table names, and with that id you can go into dba_fields table to get the field information.

I do not know what MySQL has. I recommend looking for MySQL and Oracle documentation.

Good Luck

Mark
reply
    Bookmark Topic Watch Topic
  • New Topic