SHARE
TWEET

Untitled

a guest Aug 20th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static void updateKill(Player player, int kills, int deaths, boolean remove) {
  2.         int kill = getKills(player);
  3.         kills+=kill;
  4.         if(isUserExists(player)) {
  5.             try {
  6.                 PreparedStatement ps = MySQL.getConnection().prepareStatement("UPDATE creepergames SET Kills = ? WHERE Name = ?");
  7.                 ps.setString(1, player.getName());
  8.                 ps.setInt(2, kill);
  9.                 ps.setInt(3, deaths);
  10.                 ps.executeUpdate();
  11.             } catch (SQLException e) {
  12.                 // TODO Auto-generated catch block
  13.                 e.printStackTrace();
  14.             }
  15.         }else {
  16.             try {
  17.                 PreparedStatement ps = MySQL.getConnection().prepareStatement("INSERT INTO creepergames (Name,Kills,Deaths) VALUES (?,?,?)");
  18.                 ps.setString(1, player.getName());
  19.                 ps.setInt(2, kills);
  20.                 ps.setInt(3, deaths);
  21.                 ps.executeUpdate();
  22.             } catch (SQLException e) {
  23.                 // TODO Auto-generated catch block
  24.                 e.printStackTrace();
  25.             }
  26.         }
  27.        
  28.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top