Code example for Connection

Methods: close, commit, rollback

0
 
    /** {@inheritDoc} */ 
    public void close(Reporter reporter) throws IOException {
      try { 
        statement.executeBatch();
        connection.commit();
      } catch (SQLException e) {
        try { 
          connection.rollback();
        } 
        catch (SQLException ex) {
          LOG.warn(StringUtils.stringifyException(ex));
        } 
        throw new IOException(e.getMessage());
      } finally { 
        try { 
          statement.close();
          connection.close();
        } 
        catch (SQLException ex) {
          throw new IOException(ex.getMessage());
        } 
      }