Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to extract database metadata  RSS feed

 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
thank you for reading my post
is there any way that i can extract a database metadata into a .sql file or a posibility to extract the metadata and forward it to another database?
is there any library that make this job easier to do ?
it looks that directly using conn.getMetaData(); will be the hard way.


thanks
 
Purushoth Thambu
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which database are you referring to? If you are in oracle 9i you can try DBMS_METADATA package (GET_XML and GET_DDL). Tools like TOAD supports this pretty good (with depedent objects w/o data).
 
Scott Selikoff
author
Bartender
Posts: 4093
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oracle is nice in that you can access any user table as a more abstract general table. What kind of meta data do you want though? Try to provide an example of what you are trying to do.

One option is to use a db generation tool that generates your JDBC code based on a one-time review of the database using JDBC getMetaData() calls. This could be time consuming per call but not so much if the code is generated infrequently.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!