View Single Post
Old 29-06-2007, 17:12   #8
andbin
Senior Member
 
L'Avatar di andbin
 
Iscritto dal: Nov 2005
Cittā: TO
Messaggi: 5206
Quote:
Originariamente inviato da DigitalKiller Guarda i messaggi
Codice:
for (int i = 0; i < colonne; i++) {
     		    if (rs.getString(i + 1).equals("true") || rs.getString(i + 1).equals("false")) {
     			record.add(rs.getBoolean(i + 1));
     		    } else {
     			record.add(rs.getString(i + 1));
     		    }
     		}
Che ne pensi?
No, non mi sembra una buona cosa. Se vai a vedere la documentazione di getBoolean(), dice:
If the designated column has a datatype of CHAR or VARCHAR and contains a "0" or has a datatype of BIT, TINYINT, SMALLINT, INTEGER or BIGINT and contains a 0, a value of false is returned. If the designated column has a datatype of CHAR or VARCHAR and contains a "1" or has a datatype of BIT, TINYINT, SMALLINT, INTEGER or BIGINT and contains a 1, a value of true is returned.
__________________
Andrea, SCJP 5 (91%) - SCWCD 5 (94%)
andbin č offline   Rispondi citando il messaggio o parte di esso