We study the relation between the metallicity of quasar broad line region (BLR) and black hole (BH) mass (10(7.5)-10(10) M-circle dot) and quasar bolometric luminosity (10(44.6)-10(48) erg s(-1)) using a sample of similar to 130000 quasars at 2.25 <= z <= 5.25 from Sloan Digital Sky Survey Data Release 12 (DR12). We generate composite spectra by stacking individual spectra in the same BH mass (bolometric luminosity) and redshift bins and then estimate the metallicity of quasar BLR using metallicity-sensitive broad emission-line flux ratios based on the photoionization models. We find a significant correlation between quasar BLR metallicity and BH mass (bolometric luminosity) but no correlation between quasar BLR metallicity and redshift. We also compare the metallicity of quasar BLR and that of host galaxies inferred from the mass metallicity relation of star-forming galaxy at z similar to 2.3 and 3.5. We find quasar BLR metallicity is 0.3 similar to 1.0 dex higher than their host galaxies. This discrepancy cannot be interpreted by the uncertainty due to different metallicity diagnostic methods, mass metallicity relation of galaxy, metallicity gradient in quasar host galaxies, BH mass estimation, the effect of different spectral energy distribution models, and a few other potential sources of uncertainties. We propose a possibility that the high metallicity in quasar BLR might be caused by metal enrichment from massive star formation in the nucleus region of quasars or even the accretion disc