Actually trying to code this using map reduce program.

On Thu, Jun 7, 2012 at 6:22 AM, shashwat shriparv
<dwivedishash...@gmail.com> 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 
> <abhishek.dod...@gmail.com>wrote:
>
>> hi all,
>>
>>       I have a scenario where i should generate the sequence id . All
>> my tables are in DB2
>>
>
>
>
> --
>
>
> ∞
> Shashwat Shriparv

Reply via email to