• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting list of table names in Oracle and MySQL

 
hadzrul hashim
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic