There is a Web project built on servlets and jsp. A table is stored in the database; one of the fields stores time for deletion.

It was thought to use a filter that every time the servlet is called will check the database and delete obsolete data. Can derby have any built-in capabilities to delete a post-expiration record? I can not figure out how to do it better.

Request to delete a row

DELETE FROM my_table WHERE my_table.delete_day==current_day 
  • 3
    Why do not you use some kind of sheduler, run once a day, or after a specified period? - MrFylypenko
  • is sheduler a java technology? Or does this apply to derby? - Puzzl
  • one
    This is java technology, here's an example of how to create on pure java. You can also use Quartz, Spring, depending on the technology that you have. This does not apply to derby. - MrFylypenko
  • This is how you come up with. You can in kroon set java org.apache.derby.tools.ij my_file.sql . For j8 already have docs.oracle.com/javase/8/docs/api/java/util/concurrent/… . Spring has its own. And there are several other implementations, for example Quartz. - Sergey Mitrofanov

0