Ike:
I have a hashmap (or an arraylist), what kind of data type would I specify
this as in creating it's column in a MySql table. How do you store such a
data structure typically in a database???
You could create a table of its own for the entries of all hash maps
(assuming that keys and values are all of a type that has a
corresponding SQL type like int or varchar and that the types are the
same for all keys and all values).
This example stores two maps, one with nick name / full name pairs,
one with abbreviation / meaning pairs. All values are strings.
keyvaluepairs
id key value
1 "bob" "Bob Smith"
2 "chris" "Christine Miller"
3 "asap" "as soon as possible"
4 "imho" "in my humble opinion"
5 "cu" "see you"
maps
map_id key_value_id
1 1
1 2
2 3
2 4
2 5
The name map is 1 and the abbrev. map is 2 (map_id). You can use those
keys in your other table to reference a map. Now if you want to have
all keys and values of, say, map 2, you can use a join query statement
over the above two tables to retrieve them.
If you want easy storage of (possibly complex) objects, maybe OODBMS
are more interesting for you:
<
http://directory.google.com/Top/Com...se_Management_Systems_-_DBMS/Object-Oriented/>.
Regards,
Marco