Hi all, I've blending my mind with how to specify the time out for a select query. Some time, because of problem in DB server, the SQLQuery keep hanging without throwing any SQLException. This result in user having to wait an infinite amount of time. Does any of you have any idea on how make JDBC queries time-out aware ? or in general how to make a method calling a time-out based operation ? Thanks a lot.
SCJP 1.4, SCWCD
Joined: Mar 16, 2004
You could wrap the JDBC call in a UserTransaction and call setTransactionTimeout. But I'd be looking at the DB and sort out whatever problem is the cause. DBs should not just hang.