• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Muti dimensional Collection

 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which is the best comination in collection to define multi dimensional to fetch resultset
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tend to use a List of Maps.
Moving this to the JDBC forum...
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I usually use a List of Maps too, except in the odd case where 2 column names from different tables within the same query are the same ( HashMap only allows one value, then overwrites the first value with the second ). In this case I use a List of Lists.
I have actually created a series of classes/interfaces designed to act like a disconnected ResultSet. Your welcome to use/modify/ignore them as like:

INTERFACES:
Results - represents a disconnected resultset
Row - represents a Row withing the Results

Map Implementation:
ResultMap - a list of Maps implementation
RowMap - Maps implementation of Row used by ResultMap

List Implementation
ResultList - List of Lists implementation of Results
ResultMap - List implementation of Row used in ResultList

Delimited Text File Readers/Writers
DelimWriter
DelimReader
[edited to add links instead of posting way too much code! and fix links]
Jamie
[ August 28, 2003: Message edited by: Jamie Robertson ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic