1

I am using java's interface DatabaseMetaData with a jdbc driver to an oracle database.

The interface uses the term catalog as one of the coordinates for the database subsets. For example, in querying for procedures (getProcedures method).

I'm not sure what does the term catalog stand for, especially considering the Oracle database.

After brief playing with the interface, I see that I can pass package names for the catalog argument to yield its members.

Does it mean that in Oracle catalog == package? The interface does define getCatalogTerm method, but in my case it returns an empty string.

infoholic_anonymous
  • 969
  • 3
  • 12
  • 34
  • 1
    Looks like that is the database name - http://stackoverflow.com/questions/7942520/relationship-between-catalog-schema-user-and-database-instance – OldProgrammer May 15 '15 at 14:00
  • @OldProgrammer If I understand this correctly, it seems `catalog` is some sort of a namespace in Oracle database. Thus a `package` is a `catalog`, but a `catalog` is a broader term, including server instance. That is why I can list package members by passing package name for the catalog argument. Is it possible that members of one package be scattered among multiple server instances? What would be the output then for my use case? – infoholic_anonymous May 15 '15 at 14:12
  • Oracle does not support catalogs, only schemas. A package is something different. The way it's defined the SQL standard, catalogs are a namespace for all objects in a database, not only procedures. –  May 15 '15 at 14:36
  • @a_horse_with_no_name thanks. do you happen to have any reference to which I could look up to for more details? While I understand that catalog and package are different entities from the point of view of sql standard, can I safely assume that, from the point of view of DatabaseMetaData interface interaction with the Oracle database, the catalog *is* the package and nothing more? More precisely, that this is the way this interface interprets the term catalog in the case of oracle database. – infoholic_anonymous May 15 '15 at 14:44
  • 1
    The catalog concept applies to **all** objects from a JDBC point of view - every DatabaseMetaData call that returns object information includes a catalog attribute. But tables, views, sequences, types and so do not have a catalog in Oracle. From my point of view, Oracle's JDBC driver simply **misuses** the catalog attribute for packages because the JDBC API does not support packages and in order to be able to distinguish a standalone procedure from a packaged procedure way maybe by (mis)using the catalog attribute (which is otherwise unused in Oracle) –  May 15 '15 at 14:58
  • @a_horse_with_no_name Is this behaviour consistent among Oracle databases from v12 up? btw it indeed seems more like a misuse, since `getCatalogs` method returns an empty ResultSet. – infoholic_anonymous May 15 '15 at 15:17

0 Answers0