wood burning stoves 2.0*
The moose likes JDBC and the fly likes getCatalogs() method in DatabaseMetaData Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
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
internet detective

Joined: May 26, 2003
Posts: 30068

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.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, 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: http://aspose.com/file-tools
subject: getCatalogs() method in DatabaseMetaData
Similar Threads
displaying all the tables from a database
Getting all the database names using java with MySql
Excel worksheet name
getCatalogs() doesn't work with Oracle 8i
Tables reflection with JDBC