I am looking for a data extraction platform that works with JDBC and DB2 9.7. I need this to extract data and create a vendor specific formatted flat file out of it. Is there a utility written in the existing DB2 driver or JDBC that will assist in flat file creation and format?
Asked
Active
Viewed 742 times
2
-
1Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. – Eel Lee Jul 30 '14 at 15:08
-
I think it's a valid question for a person unfamiliar with DB2. However, I'm having hard time reconciling the equivalency with SQL*Plus or OCI, neither of which are related to Java, with the requirement of working with JDBC. – mustaccio Jul 30 '14 at 15:13
1 Answers
1
There is an export utility, which is a part of a (freely distributed) DB2 client package. You will need either the Runtime Client or Data Server Client package.
The utility is invoked by the DB2 command line processor export
command.
You can download the latest fix pack of the client for your server version from http://www-01.ibm.com/support/docview.wss?uid=swg27016878
More information on the export
command in the manual.

mustaccio
- 18,234
- 16
- 48
- 57
-
thank you that really helps. The export command allows for data to be exported to several file formats, but none of the parameters actually let you control how data should be structured within the file i.e. column width, spacing, etc. Apologies I should've been specific about 'format'. I mean more about how the data is output and not the file's actual format. – Harish Vangavolu Jul 30 '14 at 15:37
-
The `export` command accepts any standard SQL query, so if you want to format a timestamp value in a particular way you'd say `export to ... select timestamp_format(my_ts_column, 'format string')... from ...` instead of `export to ... select my_ts_column ... from` – mustaccio Jul 30 '14 at 17:31
-
Yes but the other problem is since it's not an SQL statement we cannot invoke it through JDBC. A stored procedure might work but the output file would be stored on the database server instead of the app server where I'd like my code and output to be stored. – Harish Vangavolu Jul 30 '14 at 18:39
-
Now you see the problem of not explaining your requirements from the very beginning. You made a reference to SQL*Plus, which is also a command line processor and which you cannot invoke via JDBC either... – mustaccio Jul 30 '14 at 19:22