You function should manage a single table in parameter. And return true or false in isTableExists(). If the table doesn't exists catch the exception and return false.