Since Sql query is written by other database guy so there is possibility of not optimized query since query is retrieving data from several tables.
A slow DB call could be the cause of the problem, but then, so could something else. Without measuring where the time is spent, you'll never know.
Can you confirm using CallableStatement has any advantage over preparedStatement as i am using preparedStatement to execute query.
It's highly unlikely that either will make an appreciable difference.
Also JAX-RS is producing XML as output not JSON.Can you confirm that producing XML as output is slower comparing to JSON.
That choice, too, is unlikely to make much difference, IMO. But it's easy to
test and time, so you know for sure.