getString
actually accepts indexes as well. If you want to retrieve values according to x and y you can do the following
codes.setRow(y);
String value = codes.getString(x); // It can also be getFloat, getInt, etc. depending on the data type,
// or getValue, which gives you an Object
It works similarly to codes[x][y]
as if it's an array, but this is not commonly used.
In other cases, you may want to iterate through each single value in the row with JCoRecordFieldIterator
.
JCoRecordFieldIterator itr = codes. getRecordFieldIterator();
while(itr.hasNextField()){
JCoRecordField field = itr.nextRecordField();
String value = field.getValue(); // Or getString, getFloat, etc.
// Whatever you want to do with the value
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…