Guest User

Untitled

a guest
Nov 19th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. public int addClient(Object[] data) {
  2.  
  3. try {
  4.  
  5. if (((String)data[0]).trim().isEmpty() || ((String)data[1]).trim().isEmpty() || ((int)data[2] < 0) || ((int)data[3] <= 0)) {
  6. return StatusBar.ERR_INVALID_INPUT_CODE;
  7. }
  8.  
  9. // the line below is causing the exception
  10. String update = "INSERT INTO Client VALUES(" + ((String)data[0]).trim() + "," + ((String)data[1]).trim() + "," + ((Integer)data[3]).intValue() + "," + ((Integer)data[4]).intValue() + "," + ((Boolean)dat$
  11.  
  12. if (statement.executeUpdate(update) != 1) {
  13. return StatusBar.ERR_INTERNAL_CODE;
  14. }
  15. }
  16. catch (Exception e) {
  17.  
  18. e.printStackTrace();
  19.  
  20. return StatusBar.ERR_INTERNAL_CODE;
  21. }
  22.  
  23. return StatusBar.ERR_SUCCESS_CODE;
  24. }
Add Comment
Please, Sign In to add comment