Hi,
I would like to ask for my application which is using Hibernate3.0 and the database is Oracle8i, i have a query:-
queryStr.append(" and upper(supplier.coName) like ? ");
paramList.add(coName.replace('*','%').toUpperCase());
typeList.add(Hibernate.STRING);
The result returns back is around 2 minutes from the application. But if i run the query in oracle itself is around 6 secs.
Because the input for coName is like 'abc sdn bhd' so the query will be like "upper(supplier.coName) like 'ABC SDN BHD'" and when i run this query directly in oracle it takes around 6 secs. So i tested and change the query to be like "upper(supplier.coName) like '%ABC SDN BHD%'" and it takes around 2 minutes++.
So i would like to ask is this a hibernate bug or is it better to change the query from not using the "?", example :-
queryStr.append(" and upper(supplier.coName) like '" + coName.replace('*','%').toUpperCase() + "' ");
|