I have the following code to input data into the database using java. However, first column is actually generated automatically by postgresql database. Now, how would I change the code so it does not touch the first column?
String sql = "insert into members values (?,?,?,?)";
PreparedStatement pst = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); // I used RETURN_GENERATED_KEYS, but I don't know how to utilize it.
pst.setInt(1, memid); // I want this line to be skipped
pst.setInt(2, birthyear);
pst.setString(3, familyname);
pst.setString(4, givenname);
// Executing the insert
pst.executeUpdate();