posted 20 years ago
Bala,
If I am not mistaken, different DBMS's define "tablespace" in different ways. In any case, as far as I know, there is nothing in the JDBC API that will return the "tablespace" names. Of-course, you can get the table names via the "getTables()" method of the "java.sql.DatabaseMetaData" interface.
If you really want the "tablespace" names, then I think you will have to directly query the data dictionary of the DBMS you are working with. Naturally, the query will vary between different DBMS's. With Oracle, you can query the ALL_TABLES view, which holds both the table name as well as the tablespace name. Since I don't work with the other DBMS's you mentioned, I can't tell you how to locate the relevant information in their data dictionaries (sorry).
Good Luck,
Avi.