Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int addClient(Object[] data) {
- try {
- if (((String)data[0]).trim().isEmpty() || ((String)data[1]).trim().isEmpty() || ((int)data[2] < 0) || ((int)data[3] <= 0)) {
- return StatusBar.ERR_INVALID_INPUT_CODE;
- }
- // the line below is causing the exception
- String update = "INSERT INTO Client VALUES(" + ((String)data[0]).trim() + "," + ((String)data[1]).trim() + "," + ((Integer)data[3]).intValue() + "," + ((Integer)data[4]).intValue() + "," + ((Boolean)dat$
- if (statement.executeUpdate(update) != 1) {
- return StatusBar.ERR_INTERNAL_CODE;
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- return StatusBar.ERR_INTERNAL_CODE;
- }
- return StatusBar.ERR_SUCCESS_CODE;
- }
Add Comment
Please, Sign In to add comment