I am using Oracle JDBC Driver version - 220.127.116.11.0 in my JDBC based utility program.
the problem is when query takes more than 20-30 minutes to return the resuts ,I face "Time out" error.
I have tried printing getQueryTimeOut(); which will print '0' (Zero) I have read from JDBC API doc that Zero indicates Driver will wait for any amount of time once the query starts executing..
but still I do face this issue.
Even tried to setTimeout to some 30 minutes converting into seconds then also no gain.
can anyone tell me the workaround to this..
Are you getting a SQLException or some other timeout oriented exception?
If the query itself is timing out then you should be getting a SQLException with a relevant message. You said the timeout is set to zero so it should not be timing out at all. However, there could be some other network or session config that is timing you out. I actually experienced a situtation where we thought a query was timing out but it turned out that there was a network config (I forgot exactly what it was) set to timeout due to inactivity. This timeout period happened to be shorter than the average execution time of our query; SQLException was not thrown in this case cause the SQL timeout did not happen. After we bumped it a bit all was fine.
What is the actual exception message thrown?
BTW, if your query is taking 30 plus minutes you may want to consider tuning it and/or the tables or database involved.
There is no SQLException trace just it says :
WARNING: Read timed out not able to figure out where is this time period is defined .
tuning the query wont help me lot coz Its reported that even after 5 minutes the warning message appears [WARNING: Read timed out]
I tried with query which will take 1-2 minutes that works fine ,problem is with the queries which will take 5+ minutes