#173 Changes Query to get XID from same connection, added database #174