private boolean checkIfMemberCanBorrowAnItem()
    {
        String attribute = null;
        if(studentJRadioButton.isSelected())
        {
            attribute = studentJTextField.getText();
            memberId = studentJTextField.getText();
        }
            
        else if(facultyJRadioButton.isSelected())
        {
            attribute = facultyJTextField.getText();
            memberId = facultyJTextField.getText();
        }
            
        
            String query = "SELECT DISTINCT(ItemsBorrowed) AS ItemsBorrowed FROM members WHERE"
                    + " MemberId='"+attribute+"' ";
            try
            {
                 pst = connection.prepareStatement(query);
                 rs = pst.executeQuery();
                 if(rs.next())
                 {
                     if(studentJRadioButton.isSelected())
                     {
                         student = new Student();
                         if(student.getLimit() > (rs.getInt("ItemsBorrowed")))
                            return true;
                         else
                            return false;
                     }
                     else if(facultyJRadioButton.isSelected())
                     {
                         faculty = new Faculty();
                         if(faculty.getLimit() > (rs.getInt("ItemsBorrowed")))
                            return true;
                         else
                            return false;
                     }
                 }
            }catch(SQLException e)
            {
                JOptionPane.showMessageDialog(null,e);       
            }
            finally{
            try{
                rs.close();
                pst.close();
                }
            catch(Exception e)
            {
            }
           }
            return false;
    }