Home  >  Q&A  >  body text

java - 关于Poi,Sheet的问题

巴扎黑巴扎黑2764 days ago556

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-04-18 10:11:11

    If the three programs are executed in parallel, then each program will save the Excel after modifying it, so only the last saved Excel will be retained.
    If the three programs are executed in series, then each program opens Excel first, then selects the sheet, then makes modifications, saves Excel after modification, and the next program is executed in this way again, how can overwriting occur?

    reply
    0
  • ringa_lee

    ringa_lee2017-04-18 10:11:11

    If it is a multi-threaded file operation, lock the code that operates excel, read excel first, and then write.

    reply
    0
  • Cancelreply