Thursday, June 13, 2013

java.sql.SQLException: No value specified for parameter 3


#Problem:
(1)
java.sql.SQLException: Duplicate key or integrity constraint violation message from server: "Duplicate entry '1' for key 'PRIMARY'"
(2)

java.sql.SQLException: No value specified for parameter 3
at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:2368)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1799)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1667)




 pst = con.prepareStatement(sql);

  pst.setString(1"Rakesh");
  pst.setString(2"Kanwal");
  pst.setString(3"Delhi");
  pst.setString(4null);

No comments:

Post a Comment