Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.lobbysystem.delta203.bukkit.mysql;
- import java.sql.PreparedStatement;
- import java.sql.ResultSet;
- import java.sql.SQLException;
- public class Coins_Get_MySQl {
- public static int getCoins(String uuid) {
- try {
- PreparedStatement ps = Coins_MySQl.con.prepareStatement("SELECT Coins FROM Web_LoginDatas WHERE SpielerUUID = ?");
- ps.setString(1, uuid);
- ResultSet rs = ps.executeQuery();
- while(rs.next()) {
- return rs.getInt("Coins");
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- return -1;
- }
- public static void setCoins(String uuid, int input) {
- try {
- PreparedStatement ps = Coins_MySQl.con.prepareStatement("UPDATE Web_LoginDatas SET Coins = ? WHERE SpielerUUID = ?");
- ps.setString(2, uuid);
- ps.setInt(1, input);
- ps.executeUpdate();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement