Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void getPlayer(String name) {
- PreparedStatement statement = null;
- Connection connection = null;
- try {
- String select = ("SELECT * FROM money WHERE UUID=?");
- connection = hikariDataSource.getConnection();
- statement = connection.prepareStatement(select);
- statement.setString(1, getUuid(name));
- ResultSet result = statement.executeQuery();
- result.next();
- if (playerExist(name) != true) {
- String update = "INSERT INTO money(UUID,NAME,TOKENS) VALUE (?,?,?)";
- PreparedStatement pre = null;
- Connection con = null;
- con = hikariDataSource.getConnection();
- pre = con.prepareStatement(update);
- pre.setString(1, getUuid(name));
- pre.setString(2, name);
- pre.setString(3, String.valueOf(0));
- pre.executeUpdate();
- }
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement