-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate Query
PostPosted: Wed Feb 14, 2007 8:40 am 
Newbie

Joined: Wed Feb 14, 2007 8:19 am
Posts: 1
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() + "' ");


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.