ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Slate <jsl...@mtl.mit.edu>
Subject passing in java date
Date Thu, 21 Aug 2008 12:57:50 GMT

We were having some problems where the time on the Web server and the DB 
server are off by a few milliseconds and it was causing some issues, so 
rather than rely on getting the times synched perfectly, I thought we 
could just always use the time on the Web server by passing in the 
current time when querying.

I could change all of our "getSqlMapClientTemplate()..." calls to pass 
in a map that includes the current java date/time, but that would be a 
lot of work (and I'm lazy). So I was trying to find a way to always make 
"now" available  to my SQL maps.

For example:
SELECT * FROM foo WHERE start_time <= ${now}

I know I can use static properties from a properties file like this. Is 
there a way to do this for something more dynamic like "current time?"


View raw message