public ArrayList<Librarian> searchLibrarian(String columnName, String cond) {
		Connection conn = null;
		Statement st=null;
		ResultSet rs=null;
		ArrayList<Librarian> Librarians = null;
		
		try {
			conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/librarysystem?user=admin&password=123456");
			String query = null;
			
			// If columnName and cond is not null, select specified tuples, otherwise, select all rows
			if (columnName != null && cond != null) {
				if (columnName == "idNumber") {
					query = "SELECT * FROM Librarian WHERE " + columnName + " = '" + cond + "'";
				} else {
				query = "SELECT * FROM Librarian WHERE lower(" + columnName + ") LIKE '%" + cond + "%'";
				}
			} else {
				query = "SELECT * FROM Librarian";
			}
			
			st = conn.createStatement();
			rs = st.executeQuery(query);
			Librarians = new ArrayList<Librarian>();
			
			// Convert tuples from ResultSet to list of Librarian objects
			while (rs.next()) {
				Librarian l = new Librarian();
				l.setIdNumber(rs.getInt(1));
				l.setName(rs.getString(2));
				l.setAddress(rs.getString(3));
				Librarians.add(l);
			}
		} catch (SQLException e) {
			e.getMessage();
		} finally {
			try {
				if (conn != null)
					conn.close();
				if (st != null) 
					st.close();
				if (rs != null) 
					rs.close();
			} catch (Exception e) {
			}
		}
		return Librarians;
	}