Help coderanch get a
new server
by contributing to the fundraiser
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

query issue

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI, I have a servlet that performs two differents query to a mysql db in function of the task,so only one at a time is used but one after the other in very fast sequence, each of them return a json, I have two identical methods parameters_list and potentials_list, but only parameters_list works properly the second one obtain from mysql an empty resultset, I can not figure why. Here it is the relevant code for the two methods:
Parameters_list is the working one


and the code for potentials_list that does not work


both methods
use a third one for json encoding

the two methods are the same apart the query and the key I use for the json to return, so do not understand whi potential_list obtain a void resultSet in queryDb4Potentials, I wish someone can help me,
thanks in advance
 
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by "doesn't work." Does it throw an exception or just not return any data?

Also, there is a lot of code here. Could you try replying to this post by just showing what is different between the two examples?
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you ran the query independently and saw the results? However the code looks alright.

I'm not sure why you have used two different methods for the same logic. I would suggest to modularize these methods and try running the core logic within a single method. To me, it just seems to be a problem with too much code duplication rather than some technical issue.
 
giuseppe D'Amico
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply, I solved, just a stupid mistake.
 
reply
    Bookmark Topic Watch Topic
  • New Topic