[java] Auto Number?,
Members - Reputation: 223
Posted 11 June 2001 - 02:04 AM
Members - Reputation: 122
Posted 11 June 2001 - 03:11 PM
The standard way of providing primary Ids is to create them yourself, rather than allow the dB to do it.
The easiest way to do it is the following:
ID = day + month + hour + second + minute + randRange(0,100) + randRange(0,100);
(althought thats some strange pseudo code, and it reality, yoiu can place them in any order you like..or randomize the order? for extra security.)
But it will provide you with a 99.9999999...etc percent sure way of generating a unique ID (hasn''t failed me yet)
The added benefit is that you know the ID when you create the item, so you can use it as you see fit elsewhere.
Vector7 Software Engineering
Members - Reputation: 593
Posted 14 June 2001 - 04:53 AM
Obviously you would have to sprinkle the requisite try/catch-statements in there as well.
- Death awaits you all with nasty, big, pointy teeth. -