Chciałbym sprawdzić typy kolumn bazy danych. W AbstractTableModel mam odpowiednią funkcję:
public Class getColumnClass(int column) {
String type;
Class c = null;
try {
type = rsmd.getColumnClassName(column+1);
c = Class.forName(type);
}
catch (Exception e) {
return super.getColumnClass(column);
}
return c;
}
W tej pętli chciałbym sprawdzić czy kolumna jest typu Integer.Jednak typ.isInstance(sprInt) nie zwraca prawdy mimo, że kolumny sa tego typu. Jak powinienem zapisać ten warunek if aby zwracał prawdę gdy natrafiam na kolumnę typu Integer ?
for(int i=0;i<liczbaKol;i++){
Class typ=modelT.getColumnClass(i);
if(typ.isInstance(sprInt))
System.out.println("jest");
}
private Integer sprInt