Old versions of the Teradata JDBC Driver had bugs in this area, but we believe those have been corrected.
The intended behavior is as follows, regardless of the kind of SQL request that is executed:
SQLException.getErrorCode = 751 indicates that the application interrupted the operation with Thread.interrupt.
SQLException.getErrorCode = 802 indicates that a query timeout occurred.
Both these exceptions have getSQLState = HY000.