• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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
 
Yeah, but does being a ninja come with a dental plan? And what about this tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic