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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

resultset problems

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Ok, I'm having trouble with what I hope to be a simple issue. In my cd store web app, I have a servlet mapped as my index to load the music categories and then forward over to my actual index page. This servlet references a model, and right now I have the model returning a resultset. However when I try to process the resultset within my servlet it throws an exception. I was told I should try assigning the incoming resultset from the model to a cachedrowset object, will that work?

Otherwise, I also have a bean made to hold individual category information. Would it be better to have the model process the result set and put the info into beans, which could be put into an ArrayList and then returned to the servlet controller instead?
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Originally posted by Jenn Person:
Would it be better to have the model process the result set and put the info into beans, which could be put into an ArrayList and then returned to the servlet controller instead?


Yes, this would be better. Regardless of how/whether it is possible to pass around resultsets, it is better to separate the model (query) and view (servlet/jsp) completely.

If you needed the resultset for back end processing, the CachedResultSet would work.
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Jenn,
Please don't cross-post the same question in multiple forums.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic