docs: def query(self, query, args=None):
  		"""
  		Execute the passed in query against the database
  		
  		@param query: MySQL Query to execute. %s or %(key)s will be replaced by parameter args sequence
  		@param args: Sequence of value to replace in your query. A mapping may also be used but your query must use %(key)s
  		@author: Nick Verbeck
  		@since: 5/12/2008
  		"""
  		self.affectedRows = None
  		self.lastError = None
  		cursor = None
  		
  		try:
  			try:
  				self._GetConnection()
  				
  				log.logger.debug('Running query "%s" with args "%s"', query, args)
  				self.conn.query = query
  				
  				#Execute query and store results
  				cursor = self.conn.getCursor()
  				self.affectedRows = cursor.execute(query, args)
  				self.lastInsertID = self.conn.connection.insert_id()
  				self.rowcount = cursor.rowcount
  				
  				log.logger.debug('Query Resulted in %s affected rows, %s rows returned, %s last insert id', self.affectedRows, self.lastInsertID, self.rowcount)
  				
  				self.record = cursor.fetchall()
  				self.conn.updateCheckTime()
  			except Exception, e:
  				self.lastError = e
  				self.affectedRows = None
  		finally:
  			if cursor is not None:
  				cursor.close()
  			self._ReturnConnection()
  			if self.lastError is not None:
  				raise self.lastError
  			else:
  				return self.affectedRows