Add exception handling in connectDB
Throws exception if resultset stream was not fully consumed
reformat code
module refactoring