If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
I am very new to DB2.
I am successfully able to connect to DB2 from java client.
By using the following method java.sql.DatabaseMetaData.getSchemas() i was able to retrieve all the schema names under that particular data base.
now my problem is i have all the system schema's also.
1)Is there any way to eliminate the systems schema's.(System in the sense those are used by DB2)
2)Is there any way to eliminate the system tables from a database when you are retrieving the table names from the data base.(System means those are used by DB2)
I would really appreciate if soem one helps me out here.
I do not see a way to filter out those through databasemetadata. You can however use the system catalog tables and use regular SQL to get what you want.
SELECT TABSCHEMA, TABNAME, TYPE, COLCOUNT,
KEYCOLUMNS, KEYINDEXID, KEYUNIQUE
FROM SYSCAT.TABLES
WHERE TABSCHEMA NOT LIKE 'SYS%' AND
TYPE = 'T'
I got the result thanks a lot....