There shall be a statewide license and record database which shall be created and maintained by the division of state police the cost of which shall not be borne by any municipality. Records assembled or collected for purposes of inclusion in such database shall not be subject to disclosure pursuant to article six of the public officers law. Records containing granted license applications shall be periodically checked by the division of criminal justice services against criminal conviction, mental health, and all other records as are necessary to determine their continued accuracy as well as whether an individual is no longer a valid license holder. The division of criminal justice services shall also check pending applications made pursuant to this article against such records to determine whether a license may be granted. All state agencies shall cooperate with the division of criminal justice services, as otherwise authorized by law, in making their records available for such checks. The division of criminal justice services, upon determining that an individual is ineligible to possess a license, or is no longer a valid license holder, shall notify the applicable licensing official of such determination and such licensing official shall not issue a license or revoke such license and any weapons owned or possessed by such individual shall be removed consistent with the provisions of subdivision eleven of section 400.00 of this article. Local and state law enforcement shall have access to such database in the performance of their duties. Records assembled or collected for purposes of inclusion in the database established by this section shall be released pursuant to a court order.