Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (resGetMembersOfGroup.next())
- {
- String memberName = resGetMembersOfGroup.getString(3);
- lst.add(memberName);
- boolean _isExists = true;
- String sqlCheckAnotherExistsInbox = "select * from chatapp.inbox where sender = '" + memberName + "' and receiver = " + receiver + ";";
- ResultSet resCheckAnotherExistsInbox = this.query(sqlCheckAnotherExistsInbox);
- try {
- resCheckAnotherExistsInbox.next();
- resCheckAnotherExistsInbox.getString(3);
- }
- catch (SQLException e){
- _isExists = false;
- }
- if (_isExists) {
- String sqlUpdateIdLastMess = "update chatapp.inbox set idLastMess = " + lastIdMess + ", lastTime = '" + lastTime + "' where sender = '" + memberName + "' and receiver = " + receiver;
- this.update(sqlUpdateIdLastMess);
- }
- else
- {
- String sqlInsertInbox = "insert into chatapp.inbox values (" + lastIdMess + ", '" + lastTime + "', '" + memberName + "', " + receiver + ");";
- this.update(sqlInsertInbox);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement