Hello All,

I need to create a java code for auto numbering.

A value will be mentioned in a table in database eg 10000.

The java file has to retrive the database value and start the auto numbering from that particular number.

It should increment by 1 for the next data as soon as we click on Save button.

I am not able to get any hint as to how to start.

Could anyone please help me in this?

Thanks in Advance.
Pooja

This is database stuff, when you create in new table a column you would indicate that it is auto-increment and you should be also able to set from which number you wish to start(see this video for example http://www.youtube.com/watch?v=hiWqqlT0G2E)

Thanks for the quick reply, but the actual scenario is as below:

Actually we have an application in such a way that it depends on the user if he wants to have an autonumber for id or not.

If the autonumber radiobutton is enabled then it will take the value from the table where the value is stored.

If the autonumber radiobutton is disabled then the user will be able to enter any id in the front end.

Sorry, I can't help you there as it is fault of someone who took the requirements that he/she allowed for such nonsense.

Sorry, I can't help you there as it is fault of someone who took the requirements that he/she allowed for such nonsense.

Thanks for ur reply...

This requirememt is because if the project goes to different clients then it would depend whether that organization requires auto number or not.

Thanks for ur reply...

This requirememt is because if the project goes to different clients then it would depend whether that organization requires auto number or not.

Thank u all.
I did the coding and got it correctly.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.