@Override
  public void close(boolean abort) throws IOException {
    if (abort) {
      Connection conn = dbRecordWriter.getConnection();
      try {
        conn.rollback();
      } catch (SQLException ex) {
        LOG.warn("Failed to perform rollback on connection", ex);
      } finally {
        try {
          conn.close();
        } catch (SQLException ex) {
          throw new IOException(ex.getMessage());
        }
      }
    } else {
      dbRecordWriter.close(null);
    }
  }
JdbcRecordWriter is wrapper class to write data to the underlying database.
jdbc-handler/src/main/java/org/apache/hive/storage/jdbc/JdbcRecordWriter.java