Assuming that I have acquired the db specific function name, how do I go about executing it from within Hibernate?
FMcGeough wrote:
In general, using time/date to synchronize is troublesome and error prone. With that disclaimer :
If you only want to work with a single server db (or a couple) then you might try :
DatabaseMetaData meta = connection.getMetaData();
// Get the list of time and date functions
String timedateFunctions[] = meta.getTimeDateFunctions().split(",\\s*");
This will give you a list of the db specific functions provided by the database and you might find one that's useful. You could also write a stored proc for the database that updates last-sync-time for a client at the end of your data generation. Then use that to select new data on next sync.