SHARE
TWEET

Untitled

a guest Oct 21st, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void hasRecordAsync(final CallBack<HashMap> callBack, final Player player) {
  2.         Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
  3.             @Override
  4.             public void run() {
  5.                 final HashMap<String, Boolean> result = new HashMap<String, Boolean>();
  6.      
  7.                 PreparedStatement q = connection.prepareStatement("SELECT * FROM " + tableName + " WHERE " + rowUsername + " = ? LIMIT 1");
  8.                
  9.                 q.setString(1, player.getName());
  10.                
  11.                 ResultSet resultat = q.executeQuery();
  12.                 boolean hasRecord = resultat.next();
  13.                 q.close();
  14.      
  15.                 result.put("hasRecord", hasRecord);
  16.      
  17.                 Bukkit.getScheduler().runTask(plugin, new Runnable() {
  18.                         @Override
  19.                         public void run() {
  20.                             callBack.onSuccess(result);
  21.                         }
  22.                
  23.                 });
  24.             }
  25.         });
  26.     }
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