Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix data not showing with sql query/java?

Tags:

java

Good day all. I am coming to a problem where I implement xPayService.getJobAutocomplete("searchValue"); and my data has been stopped showing in my frontend. can anyone check what is going on to help me fix it. thanks

Here is my java code:

          // this is in different class 
 public void loadSearchList() throws SQLException, NamingException, URISyntaxException, IOException, ParseException {
     List<JobSearchItem> jobSearchList = xPayService.getJobAutocomplete("searchValue");
        this.setJobSearchItems(jobSearchList);
    }

// this is into another class too.
public List<JobSearchItem> getJobAutocomplete(String searchValue)  {
        String sValue = "%" + searchValue.toUpperCase() + "%";
        return dataUtilityService.getJdbcTemplate().query(SQL_GET_AUTOCOMPLETE, 
                        new Object[]{sValue, sValue}, jobSearchItemMapper);
    }
like image 297
Mike Avatar asked Aug 17 '26 01:08

Mike


1 Answers

Please note that question is updated later so this is partial answer now

getJobAutocomplete expects a parameter and you are not passing it that is the reason you are getting an error.

Replace your string search value with your_serach_string in the line below and it should work

List<JobSearchItem> jobSearchList =xPayService.getJobAutocomplete("search_string");

Update

In below code you should pass your query string. for ex if you want to search for an apple then you should pass apple in the code below.

String search = "apple"
List<JobSearchItem> jobSearchList = xPayService.getJobAutocomplete(search);
    this.setJobSearchItems(jobSearchList);
like image 190
Jainik Avatar answered Aug 20 '26 04:08

Jainik