Greg Charles wrote:I'm not sure what your question is. At first, I thought the implied question was, "Why doesn't this work?" Looking at your code though, I don't see that you've made any attempt to implement the functionality you describe. Is your question, "Will someone do this for me?" That's not really what we do here. Try to do your own work, and if you run into problems, we can help guide you. You'll want to hold the previous value in a variable, and compare it with the current value.
Steve
Steve Dyke wrote:I am using while loop to iterate over a ResultSet(remote data) building an array. One of the columns can have several records with the same value I would like to add an element to my array when this column changes value.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Steve Dyke wrote:I am using while loop to iterate over a ResultSet(remote data) building an array. One of the columns can have several records with the same value I would like to add an element to my array when this column changes value.
So, am I right in thinking that you only want to display rows from your ResultSet where a specific column has a distinct value?
If so, you might want to think about a Map keyed by that column; though how you go about choosing the other values to display I really have no idea. Alternatively (and possibly better), write your SQL query so that it only returns distinct values for that column. That's what databases were designed for, after all.
Another tip: From the sound of it, you're mixing display issues (different coloured columns) with the process of extracting what you want to display. Keep these things completely separate. Indeed, I'd say that you should be able to test the data portion of your program without any kind of GUI whatsoever.
Winston
Junilu Lacar wrote:To reiterate what Winston already already said, keep display concerns separate from data access concerns. If you are using JSPs to display the table of data then you can combine conditional logic and CSS classes to control the color of table rows.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:I'd like your opinion; because my first thought when I saw that data was that I would actually process it to create an undisplayed "group break" field (perhaps a number), simply to minimize the processing requirements for the GUI - and also to decouple what it represents from how it's processed for display. Is this a reasonable approach or merely a manifestation of my dislike of all things GUI and Webby?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |