Advertisement
Oliinyk

Untitled

Jan 13th, 2023
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. @Override
  2. public String getCharacterUserGroup(String userName) {
  3. try (Connection conn = DriverManager.getConnection(
  4. sqlPropertiesConfig.getLuckperms(),
  5. sqlSecurityConfig.getUsername(),
  6. sqlSecurityConfig.getPassword())) {
  7. PreparedStatement ps = conn.prepareStatement("SELECT * FROM players WHERE username = ?");
  8. ps.setString(1, userName);
  9. ResultSet rs = ps.executeQuery();
  10. return (rs.next()) ? rs.getString("primary_group") : "";
  11. } catch (Exception e) {
  12. // handle the exception
  13. System.out.println("Error occured\n" + e.getMessage());
  14. return "";
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement