extract data from database using multi-threading technique