Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. This error "Not all parameters have been populated" usually occurs when we miss passing a value for the single question mark. Please make sure you are passing values to all question marks while executing the prepared statements.
  2.  
  3. Example : (in JDBC context)
  4. ~~~~~~~~~~~~~~~~~~~~~
  5.  
  6. PreparedStatement ps = new PreparedStatement(‘select * from demo where id >?”);
  7. ps.setInt(1,11); #setting the question mark value
  8. ResultSet rs =ps.executeQuery();
  9.  
  10. The above snippet will not throw an error.
  11.  
  12. PreparedStatement ps = new PreparedStatement(‘select * from demo where id >?”);
  13. ResultSet rs =ps.executeQuery();
  14.  
  15. The above snippet will throw an error as there are insufficient parameters.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement