Just declare the id column as an integer id, not the primary key NULL auto_increment
after that execute this code
ResultSet ds=st.executeQuery("select * from user"); while(ds.next()) { ds.last(); System.out.println("please note down your registration id which is "+ds.getInt("id")); } ds.close();
the above code will show you the current row id
if you delete ds.last() than display all the id column values
ANURAG SHARMA Jul 31 '15 at 7:45 2015-07-31 07:45
source share