I try to insert into table with sequence .nextval as primary key, the sql in Java is
sql = "INSERT INTO USER
(USER_PK, ACCOUNTNUMBER, FIRSTNAME, LASTNAME, EMAIL )
VALUES
(?,?,?,?,?)";
ps = conn.prepareStatement(sql);
ps.setString(1, "User.nextval");
ps.setString(2, accountNumber);
ps.setString(3, firstName);
ps.setString(4, lastName);
ps.setString(5, email);
However, the error is ORA-01722: invalid number
All the other fields are correct, I think it is the problem of sequence, is this correct?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…