Java query approach added