i have table with 2 columns 1.column1 2.column2(its unique) now through java coding i am inserting data through 2 methods in the first method i want to insert data ,in this coumn1 filed should be auto increment(for new user)
String sql = "INSERT INTO table (column1, column2) values(?, ?)";
pstm = connection.prepareStatement(sql);
pstm.setInt(1, auto_incrmentvalue need to set);
pstm.setInt(2,column2);
in the second method insert data with what i want
String sql = "INSERT INTO table (column1, column2) values(?, ?)";
pstm = connection.prepareStatement(sql);
pstm.setInt(1, column1);
pstm.setInt(2,column2);
how to set auto increment value in the first method
NOTE:Here column1 is not a primary key