Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void hasRecordAsync(final CallBack<HashMap> callBack, final Player player) {
- Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
- @Override
- public void run() {
- final HashMap<String, Boolean> result = new HashMap<String, Boolean>();
- PreparedStatement q = connection.prepareStatement("SELECT * FROM " + tableName + " WHERE " + rowUsername + " = ? LIMIT 1");
- q.setString(1, player.getName());
- ResultSet resultat = q.executeQuery();
- boolean hasRecord = resultat.next();
- q.close();
- result.put("hasRecord", hasRecord);
- Bukkit.getScheduler().runTask(plugin, new Runnable() {
- @Override
- public void run() {
- callBack.onSuccess(result);
- }
- });
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement