在我的表中,我使用序列自动创建id
如何使用Netbeans
插入此表我尝试使用代码插入值并出现以下错误
[Microsoft] [Oracle的ODBC驱动程序] [Oracle] ORA-00913:值太多
代码是:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try
{
String sql=("insert into customer values(seq_user.nextval,?,?,?,?,?,?,?)");
pstmt=con.prepareStatement(sql);
pstmt.setString(1,lname.getText());
pstmt.setString(2,fname.getText());
pstmt.setString(3,email.getText());
pstmt.setString(4,password.getText());
pstmt.setString(5,address1.getText());
pstmt.setString(6,address2.getText());
pstmt.setString(7,city.getText());
pstmt.executeUpdate();
}
catch(SQLException ex){
JOptionPane.showMessageDialog(this,ex.getMessage());
}