• Post Reply Bookmark Topic Watch Topic
  • New Topic

Muti dimensional Collection  RSS feed

 
aakash bhatt
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which is the best comination in collection to define multi dimensional to fetch resultset
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tend to use a List of Maps.
Moving this to the JDBC forum...
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • 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 ]
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!