Java? Oracle? With mysql? Clueless...
I can think of the logic(how it should be operated, i think), but no, coding, i have no idea how to send it to mysql through java nor oracle. Sorry dude.
But if it's just mysql, sure i can help, i guess.
q1. you're gonna have to retrieve the data first b4 java detects it's expired(if-else) before it sends any commands to trrigger mysql to delete the record.
Something like
SELECT * FROM (the table containing date)
WHERE (date column) <= 'currentdate'; (not sure about the 'currentdate', will check again).
q2. you're gonna have to retrieve the data about the certain customer, to check whether it is a good customer(example, "good customer" set from mysql and an if-else statement to check, to make a decision, discount or not.
About q2 command, maybe i can help, my book's in the car :P he he