As you are a beginner, so I am trying to provide you a very easy solution, might be not very much efficient.
static Timer timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
// Your database code here
if(i==4){
timer.cancel();
timer.purge();
}
try {
execute();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
i++;
}
}, 0, 1*1000);
In Code, 1*1000 denotes like, after how many seconds , you want to execute your code.
execute() -- will have your code to be run
i :- number of times, you want to repeat your test
in your case
i=4
timeRate should be :- 15*60*1000