Made Scala and Java examples more consistent
Added Java equivalent of Scala RelationalQuery example program