[#31935] Use JDatabaseQuery (Fix #3118)