How to determine if the error was a deadlock?
I guess the ex.getErroCode() has returned ORA-00060: deadlock detected while waiting for resource which is deadlock error. Add ORA in front of the returned error code then search online or use Oracle supplied tool oerr as demonstrated below to determine the error details.


  An error code. This is an integer value identifying the error that caused the SQLException instance to be thrown. Its value and meaning are implementation-specific and might be the actual error code returned by the underlying data source. Retrieve the error by calling the method SQLException.getErrorCode.More...





  [oracle@orcl trace]$ oerr ora 60
  
  00060, 00000, "deadlock detected while waiting for resource"
  
  Cause:  Transactions deadlocked one another while waiting for resources.
  
  Action: Look at the trace file to see the transactions and resources
           involved. Retry if necessary.