How to read a whole file and retrieve data from the DB2 database