To enable this feature, go to Admin Console -> JDBC Data Source: Configuration: Connection Pool, and set "Statement Timeout" greater than 0.
stmt = conn.createStatement();
stmt.setQueryTimeout(1);
// java.sql.Statement.setQueryTimeout();
java.sql.SQLException: ORA-01013: user requested cancel of current operation to the server log.