File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes getCatalogs() method in DatabaseMetaData Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "getCatalogs() method in DatabaseMetaData" Watch "getCatalogs() method in DatabaseMetaData" New topic

getCatalogs() method in DatabaseMetaData

Amrit Tiwana

Joined: Jun 03, 2004
Posts: 24

I'm using getCatalogs() method in DatabaseMetaData to get listing of all catalogs(database) in SQL Server 2000. I've created a DSN say 'demo'. When I create DSN, it shows me all the databases. But when I make call using getCatalogs() method in DatabaseMetaData, it doesn't return 'model' database. The others i get i.e. master, msdb, Northwind, pubs, tempdb.
Does anybody why???

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33124

What is the relationship between "model" and "demo"? I'm not sure if I'm following the question.

Off the top of my head, you may want to check that the new database has the appropriate permissions.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Amrit Tiwana

Joined: Jun 03, 2004
Posts: 24
'demo' is the DSN name which I've created.
I agree. Here's the link:
subject: getCatalogs() method in DatabaseMetaData
jQuery in Action, 3rd edition