Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. while (resGetMembersOfGroup.next())
  2. {
  3. String memberName = resGetMembersOfGroup.getString(3);
  4. lst.add(memberName);
  5. boolean _isExists = true;
  6. String sqlCheckAnotherExistsInbox = "select * from chatapp.inbox where sender = '" + memberName + "' and receiver = " + receiver + ";";
  7. ResultSet resCheckAnotherExistsInbox = this.query(sqlCheckAnotherExistsInbox);
  8. try {
  9. resCheckAnotherExistsInbox.next();
  10. resCheckAnotherExistsInbox.getString(3);
  11. }
  12. catch (SQLException e){
  13. _isExists = false;
  14. }
  15.  
  16. if (_isExists) {
  17. String sqlUpdateIdLastMess = "update chatapp.inbox set idLastMess = " + lastIdMess + ", lastTime = '" + lastTime + "' where sender = '" + memberName + "' and receiver = " + receiver;
  18. this.update(sqlUpdateIdLastMess);
  19. }
  20. else
  21. {
  22. String sqlInsertInbox = "insert into chatapp.inbox values (" + lastIdMess + ", '" + lastTime + "', '" + memberName + "', " + receiver + ");";
  23. this.update(sqlInsertInbox);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement