I have a problem with copying the results of my query code, producing four columns into a nested map - Map<String, Map<String, Map<String, Map<Integer, Map<String, Integer>>>>> puthere = new Hashtable<String, Map<String, Map<String, Map<Integer, Map<String, Integer>>>>>();
You are setting up a Map to contain a Map to contain a Map to contain a Map? You are getting 4 columns, and what you probably want is to get a Map where you have the PRIMARY KEY from the table/ResultSet/whatever as the "K" in the Map, and the remainder, probably put into a class designed to hold the remaining three columns, as the "E." [ June 22, 2008: Message edited by: Campbell Ritchie ]
Joined: Jun 22, 2008
Oh yes! I see what you mean. Run a query, get the first column, store the result in a map, then use that as key to get other values in another - say class or collection, where the Primary key equals the one in map. But the problem is one is probably gonna end up with few thousand lines to complete! but would try it though. Thanks
Joined: Oct 13, 2005
More a case of create an object to hold all the results, and use that as the "V" in your Map. Use the primary key as the "E". And it will take several milliseconds to process your thousands of lines in Java!