Just ignore SQL*Plus behaviour with simple SQL, test such queries within
p/sql blocks.
"select x.z.o1,x.z.o2 from (select get_ot z from dual *where rownum>0*)x"
will work fine with Java and any other tools.
--
Best regards,
Sayan Malakshinov
Oracle performance tuning engineer
Oracle ACE Associate
http://orasql.org