or some string + timestamp+ lastrow +1
On Thu, Jun 7, 2012 at 6:52 PM, shashwat shriparv <[email protected]
> wrote:
> Try something like this :
>
>
> public class MyUniqueNumber
> {
> private static MyUniqueNumber myUniqueNumber;
> int number;
> int seedValue=365432; //custom seed value to begin with
>
> private MyUniqueNumber(){ //Singleton !!!
> number=seedValue; //init to zero
> }
>
> public static MyUniqueNumber getInstance(){
> if(myUniqueNumber==null){
> myUniqueNumber=new MyUniqueNumber();
> }
> return myUniqueNumber;
> }
>
> public int getUniqueNumber(){
> number+=1; //simple increment by 1 , you can modify this further
> return number;
> }
> public static void main(String[] args)
> {
> MyUniqueNumber myUniqueNumber=MyUniqueNumber.getInstance();
> for(int n=0;n<=5;n++){
> System.out.println("read number:
> "+myUniqueNumber.getUniqueNumber());
> }
> }
> }
>
>
> On Thu, Jun 7, 2012 at 6:14 PM, abhishek dodda
> <[email protected]>wrote:
>
>> hi all,
>>
>> I have a scenario where i should generate the sequence id . All
>> my tables are in DB2
>>
>
>
>
> --
>
>
> ∞
> Shashwat Shriparv
>
>
>
--
∞
Shashwat Shriparv