I am working on a Spring MVC project. I am having issue with getting null values from database after some time interval. Following is the method written in DAO which return last entered value.
@Override
public String getDashboardData() {
String q = "SELECT deviceid FROM main_tbl order by id DESC limit 1";
String newId = jdbcTemplate.queryForObject(q, String.class);
System.out.println(newId);
return newId;
}
This method is called from jsp with every 1 sec. My problem is that, this method returns bunch of some values & null value alternately. I didn't get the actual reason because everything works fine.
My output is like below:
01
05
09
41
null
null
null
null
15
09
05
65
10
null
null
null
null
Is that problem with postgresql..? Or is their any that I missed. I’ll be very grateful for any help!