dbeayon
asked on
Iterate through db2 field names
In Java 1.6, currently I am hard coding the field values that exist in a db2 table in a Is there a method that will allow me to connect to the db2 table and iterate through the current field names?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi dbeayon,
I missed your question as I was literally "out to lunch". :)
Your solution should work fine and is generic enough that it should work with just about and database. If you need extended information from DB2 about a column (or even the column list) you can query the SYSIBM.TABLES view and interrogate the results.
SELECT * FROM SYSIBM.TABLES where table_name = 'MYTABLE'; -- Note, tables are usually in UPPER case.
Good Luck,
Kent
I missed your question as I was literally "out to lunch". :)
Your solution should work fine and is generic enough that it should work with just about and database. If you need extended information from DB2 about a column (or even the column list) you can query the SYSIBM.TABLES view and interrogate the results.
SELECT * FROM SYSIBM.TABLES where table_name = 'MYTABLE'; -- Note, tables are usually in UPPER case.
Good Luck,
Kent
ASKER
I should be able to iterate through rsInput and list the column names. Just not sure how at this point
Open in new window