use spring prepared statement mechanism for implementing the latency check