Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public String getCharacterUserGroup(String userName) {
- try (Connection conn = DriverManager.getConnection(
- sqlPropertiesConfig.getLuckperms(),
- sqlSecurityConfig.getUsername(),
- sqlSecurityConfig.getPassword())) {
- PreparedStatement ps = conn.prepareStatement("SELECT * FROM players WHERE username = ?");
- ps.setString(1, userName);
- ResultSet rs = ps.executeQuery();
- return (rs.next()) ? rs.getString("primary_group") : "";
- } catch (Exception e) {
- // handle the exception
- System.out.println("Error occured\n" + e.getMessage());
- return "";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement