Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to access names of different databases

 
amit daundkar
Ranch Hand
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i use MySQL database. suppose i have created multiple databases with create database command.
i can access name s of the tables in a particular database. but i want to access the names of different databases that i have created.
i dont understand how to do that.

please guide.
thank you.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what the DatabaseMetaData class is there for. You can obtain an instance of it through Connection.getMetaData(). The getCatalogs and getSchemas methods will provide you with lots of information.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic