Bookmark Topic Watch Topic
  • New Topic

resultset problems

 
Jenn Person
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • 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?
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36020
427
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 36020
427
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Jenn,
Please don't cross-post the same question in multiple forums.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!