I would like to find out how I can set a timeout for a Statement.executeBatch() in Java. The code works well when the database is up, but when I block the db IP in iptables, the JVM hangs at executeBatch(). I tried using .setQueryTimeout(10) but an exception is thrown: SQLException cannot be cast to SybSQLException
On database side I use Sybase and jdbc2 for connection Thank you.
PS: I can't post the code because it is company copyrighted.