i am storing some data in the database,
for tat i always need to send a unique value to it,
if the value already exists then an exception will be thrown.
so when ever i am storing in the db the value have to be unique.
then start at a value 1 more than the highest in the dB, if you wish to use incrementing type indexes. Or you could use the number of microseconds since (e.g.) 12:00am jan 1900 UTC as your 'unique number'.
Never, ever trust in database client program supplied "unique numbers". A well-designed database must have properly defined unique counter fields in its tables and/or correspondent database procedures/triggers.
Let's forget home-made x-"databases" of 80-th ;)