1. Admin Login (admin1/admin123)
↓
2. Main Menu → Adopter Management
↓
3. Adopter Dashboard → Option 4: Search Adopter by Name
↓
4. Enter search term → View LIKE search results
- Method:
AdopterCRUD.searchAdoptersByName(String searchTerm) - SQL Query:
SELECT * FROM tbl_adopter WHERE adopter_name LIKE ? ORDER BY adopter_name - Pattern:
%searchTerm%(automatic wildcard wrapping) - Case Sensitivity: Case-insensitive (MySQL default)
- SQL:
adopter_name LIKE '%John%' - Results: Found 2 adopters
- Alice Johnson (ID: 1)
- John Adopter (ID: 3)
- Status: PASS ✅
- SQL:
adopter_name LIKE '%Alice%' - Results: Found 1 adopter
- Alice Johnson (ID: 1)
- Status: PASS ✅
- SQL:
adopter_name LIKE '%A%' - Results: Found 4 adopters
- Alice Johnson (ID: 1)
- John Adopter (ID: 3)
- Marky Cruz (ID: 2)
- Theresa (ID: 4)
- Status: PASS ✅
- SQL:
adopter_name LIKE '%Johnson%' - Results: Found 1 adopter
- Alice Johnson (ID: 1)
- Status: PASS ✅
- SQL:
adopter_name LIKE '%Mark%' - Results: Found 1 adopter
- Marky Cruz (ID: 2)
- Status: PASS ✅
- SQL:
adopter_name LIKE '%xyz%' - Results: No adopters found
- Message: "No adopters found matching: xyz"
- Status: PASS ✅ (Proper empty result handling)
ID | Name | Contact | Email | Username
---|----------------|--------------|-------------------------|----------
1 | Alice Johnson | 09171234567 | alice@example.com | alicej
2 | Marky Cruz | 0999999999 | mark@example.com | markc
3 | John Adopter | 09171111111 | adopter1@example.com | adopter1
4 | Theresa | 09693764567 | ginatheresa@gmail.com | ginathis
Search Results:
ID Name Contact Email
---------------------------------------------------------------------------
1 Alice Johnson 09171234567 alice@example.com
3 John Adopter 09171111111 adopter1@example.com
- ✅ Menu Access: Option 4 displays correctly in dashboard
- ✅ Input Prompt: "Enter name to search: " works properly
- ✅ LIKE Query: SQL pattern
%searchTerm%implemented correctly - ✅ Partial Matching: Finds names containing the search term
- ✅ Case Insensitive: Works regardless of case
- ✅ Multiple Results: Displays all matching adopters
- ✅ Formatted Output: Professional table format
- ✅ Empty Results: Proper message for no matches
- ✅ Error Handling: Exception handling implemented
- ✅ Database Connection: Connects successfully for each search
The Adopter Management Dashboard → Option 4: "Search Adopter by Name" is 100% operational with:
- ✅ LIKE-based partial matching using
%wildcards% - ✅ Professional user interface with formatted results
- ✅ Robust error handling and validation
- ✅ Database integration working correctly
- ✅ Multiple search scenarios tested and verified
The feature is ready for production use! 🚀