this strikes me to be very similar to the esoteric and perhaps masonic account of solomon , who petitioned god to tell him the names and powers of all the demons on earth , so solomon could defeat them and imprison them all in jars .