With the development of the grid technology used in business field, it becomes more and more important to preserve privacy in information sharing field. This paper proposes a privacy-preserving query middleware PPQM based on credible third party in grid database, and fulfill privacy-preserving checking algorithm in PPQM to make privacy-preserving optimization of query plan before query assignment, through experiments, PPQM can effectively preserve private information and improve secure query efficiency in the application of commercial environment.