Ejemplo n.º 1
0
 /**
  * Sets the current query timeout in seconds. Calling this method will commit an open transaction,
  * even if the value is the same as before. Changing the value will affect all statements of this
  * connection. This method does not commit a transaction, and rolling back a transaction does not
  * affect this setting.
  *
  * @param seconds the timeout in seconds - 0 means no timeout, values smaller 0 will throw an
  *     exception
  * @throws SQLException if this object is closed
  */
 public void setQueryTimeout(int seconds) throws SQLException {
   try {
     debugCodeCall("setQueryTimeout", seconds);
     checkClosed();
     if (seconds < 0) {
       throw Message.getInvalidValueException("" + seconds, "seconds");
     }
     conn.setQueryTimeout(seconds);
   } catch (Exception e) {
     throw logAndConvert(e);
   }
 }