rdbms: optimize DBConnRef::getType() to avoid connections when possible