Don't use JFactory to get database object