This is used extensively
http://www.devdaily.com/java/edu/pj/...pj010016.shtml
gives a basic java example ..
Instead of ps -ef, you may use (this is a ksh example)
db2_export.ksh sample1 table1.ixf ixf "select * from table1"
where the db2_export.ksh script will be
#/bin/ksh
#
#
db2 connect to $1
db2 export to $2 of $3 $4 with ur
db2 terminate
Cheers
Sathyaram