D
Daniel
While building business classes, I store the properties/db fields in a
HashMap. So to retrieve the value I use:
String value = (String)fields.get(fieldName);
To save, I pass the HashMap on to a generic Database table class. This
class uses an Iterator to generate the sql statements;
for (Iterator e = fields.keySet().iterator(); e.hasNext() {
..
String key = (String)e.next();
sql += key + " = " + (String)fields.get(key);
..
}
So my question is if the HashMap is too slow for this? If so, is there
a better way to do the same thing?
HashMap. So to retrieve the value I use:
String value = (String)fields.get(fieldName);
To save, I pass the HashMap on to a generic Database table class. This
class uses an Iterator to generate the sql statements;
for (Iterator e = fields.keySet().iterator(); e.hasNext() {
..
String key = (String)e.next();
sql += key + " = " + (String)fields.get(key);
..
}
So my question is if the HashMap is too slow for this? If so, is there
a better way to do the same thing?