0

I'm new to programming, so need little help from you guys.

I created a simple registration from in HTML controlled by servlet using oracle. Whenever i submit my record, it gets stored perfectly in database, but I have assigned ID for every stored record which is not appearing to be increment in ascending order even after assigning primary key to ID.

Rohith K
  • 1,433
  • 10
  • 15
Kaushik
  • 9
  • 1

2 Answers2

1

There is no short way to auto increment id in database itself. This post describes good way to do it in oracle.

How to create id with AUTO_INCREMENT on Oracle?

Community
  • 1
  • 1
Gaurava Agarwal
  • 974
  • 1
  • 9
  • 32
0

Use a database sequence. And increment it by 1 every time you take a new value from that DB sequence.

Rahul Vedpathak
  • 1,346
  • 3
  • 16
  • 30