Hi all,


The Derby documentation says about the OVERLAPS predicate that it “can be done with Java methods”.


Could someone please give an example on how to do this? I need to find out if a timeframe that is calculated in my application (start and end datetimes known as Java Date objects) overlaps with any timeframes stored in the db. My table has the fields start_datetime (type TIMESTAMP) and duration_in_milliseconds (type BIGINT). There is no “end_time” field as such. Duration can be NULL in the db, then it shall be assumed the duration is one hour.


How can I write this query?


Any help greatly appreciated, thanks.