Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Which is the give good performence ?

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

Please tell me any one given below doubt:-
Which is the give good Performance between this two, when we use for find the results :-
1) Hashtable equals = new Hashtable();
equals.put("WorkExperience", workExperience);
equals.put("JsLinguisticVersion", lingVersion);
List results = commonDAO.doQuery(className, equals, null, null);
if (results.size() > 0) {
-----------------
------------------
}

2) Query q = session.createQuery(selectClause.toString()
+ fromClause.toString() + whereClause.toString()
+ orderbyClause.toString());
List results = q.list();
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are too many blanks in the code to answer that. What does commonDAO.doQuery do? Why are you using a Hashtable?

As with any performance question the best way to answer it is too benchmark both.
 
author and cow tipper
Posts: 5000
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HQL can be better than criteria type queries. I'd guess 2.

Still need more info.

-Cameron McKenzie
 
The happiness of your life depends upon the quality of your thoughts -Marcus Aurelius ... think about this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic