Hi Halil,
It depends a bit on the nature of each of the columns (ID and timestamp). If the timestamp is in a unit/precision of minutes, it's not so good to use, because if the JDBC query runs and a new row is then added for the same minute, the protocol will miss that event on the next poll. If the timestamp is accurate to a particular second, it's much less likely that you'll miss any data. But in this sense an ID column (providing that it is a numeric counter and not some kind of UUID or other non-sequential value) is the best option because it will *always* increment with each row added to the table, so you will never ever miss data.
So generally I'd recommend using ID. The only drawback of an ID is if its max size is small and there's a chance it will rollover back to 1 - then you'll stop getting new data entirely - this will obviously never happen with a timestamp. But if you don't expect the ID to ever roll over due to its max size and the rate at which stuff is added to the table, I still prefer ID because it's most accurate and will never be duplicated across multiple rows.
Cheers
Colin
------------------------------
COLIN HAY
------------------------------