JAVA - System.currentTimeMillis()

Today, when I was trying to generate a series of random number in java code to be an database primary key, I was thinking of
System.currentTimeMillis()

However, it doesn't work as the granularity is actually dependent on the OS. It might be 10 times miliseconds. Anyway, in my for loop it some times give duplicate value.


Also, I find an interesting utility in Eclipse. Let's talk about jpage next time.