src/main/java/me/firewolf8385/flameperms/api/GroupAPI.java
/**
     * Delete a group from the database.
     * @param group Group to be deleted.
     */
Delete a group from the database.
@param group Group to be deleted.
Delete a group from the database . @param group Group to be deleted .
public static void deleteGroup(String group)
    {
        try
        {
            PreparedStatement statement = MySQL.getConnection().prepareStatement("DELETE FROM fp_groups WHERE name = ?)");
            statement.setString(1, group.toLowerCase());
            statement.executeUpdate();
        }
        catch(SQLException e)
        {
            e.printStackTrace();
        }
        try
        {
            PreparedStatement statement = MySQL.getConnection().prepareStatement("DELETE FROM fp_group_permissions WHERE name = ?)");
            statement.setString(1, group.toLowerCase());
            statement.executeUpdate();
        }
        catch(SQLException e)
        {
            e.printStackTrace();
        }
        try
        {
            PreparedStatement statement = MySQL.getConnection().prepareStatement("UPDATE fp_users SET groupName=? WHERE groupName = ?");
            statement.setString(1, group.toLowerCase());
            statement.setString(2, "default");
            statement.executeUpdate();
        }
        catch(SQLException e)
        {
            e.printStackTrace();
        }
    }
public static void deleteGroup ( String group ) { try { PreparedStatement statement = MySQL . getConnection ( ) . prepareStatement ( "DELETE FROM fp_groups WHERE name = ?)" ) ; statement . setString ( 1 , group . toLowerCase ( ) ) ; statement . executeUpdate ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } try { PreparedStatement statement = MySQL . getConnection ( ) . prepareStatement ( "DELETE FROM fp_group_permissions WHERE name = ?)" ) ; statement . setString ( 1 , group . toLowerCase ( ) ) ; statement . executeUpdate ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } try { PreparedStatement statement = MySQL . getConnection ( ) . prepareStatement ( "UPDATE fp_users SET groupName=? WHERE groupName = ?" ) ; statement . setString ( 1 , group . toLowerCase ( ) ) ; statement . setString ( 2 , "default" ) ; statement . executeUpdate ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } }
Delete a group from the database.
Delete a group from the database .
// Deletes the group from sp_groups. // Deletes the group from sp_group_permissions. // Deletes the group from sp_users.