W
WP
Hello, I need to communicate with a db2 database from a java program
and this java program needs to check which "user tables" there are. I
came up with the following query which I tried in Control Center:
select tabname, tabschema from syscat.tables where tabschema !=
'SYSCAT' and tabschema != 'SYSIBM' and tabschema != 'SYSIBMADM' and
tabschema != 'SYSSTAT' and tabschema != 'SYSTOOLS';
It seems to work, it returns just the tables that I have created
myself. But it is this the best way? The java program doesn't specify
a user upon connection because it's connecting through a local system
account I think. Therefore it cannot perform selection based on
username.
I just wanted to hear if I should proceed with this solution or if
there's some better approach.
- WP
and this java program needs to check which "user tables" there are. I
came up with the following query which I tried in Control Center:
select tabname, tabschema from syscat.tables where tabschema !=
'SYSCAT' and tabschema != 'SYSIBM' and tabschema != 'SYSIBMADM' and
tabschema != 'SYSSTAT' and tabschema != 'SYSTOOLS';
It seems to work, it returns just the tables that I have created
myself. But it is this the best way? The java program doesn't specify
a user upon connection because it's connecting through a local system
account I think. Therefore it cannot perform selection based on
username.
I just wanted to hear if I should proceed with this solution or if
there's some better approach.
- WP