Derby update statements do not timeout until the (write) locks are released.
The scenario involves 2 threads starting 2 separate transactions/connections, each of them attempting to update the same row. The first thread starts the transaction, locks the row (via update) then waits 40 seconds. The second thread is started 5 seconds later and it has a 5 seconds timeout set on the statement. Upon attempting to update the same row as the first thread, it times out after 35 seconds (40 - 5) and not after the expected 5 seconds as specified in the statement timeout.
A test case is attached.
Oracle and DB2 behaves as expected.