added query module
fixed database connection remains open issue in DBTestCase