I am implementing an autocomplete functionality using Jquery, when I type the name, it fetches the record from the db, The records stored in db are mixture of capital & smal
A good solution is:
List resultList = null; Query query = session.createQuery("from DataOrganization dataOrg where lower(dataOrg.poolName) like :poolName"); query.setParameter("poolName", '%'+poolName.toLowerCase()+'%'); resultList = query.list();
So you protect your code from SQL injection