From the Cell.getNumericCell() javadocs you'll see that it returns a double
. You appear to be trying to use a rather odd technique to turn that into a string, and your chosen way of double+""
is very likely to produce long strings, as a double will often have lots of digits after the decimal point!
From your table definition:
DIVI VARCHAR2(2),
I gather that you're trying to turn the numeric cell into a two digit string. I'm not sure why you want to do that, rather than storing an INTEGER
in your database, but I'm hoping you have a good reason.... Assuming so, you should do something with DataFormatter like
DataFormatter fmt = new DataFormatter();
String divi = fmt.formatCellValue(row.getCell(27).getNumericCellValue());
if (divi.length() > 2) {
throw new IllegalStateException("Row should contain a 2 digit number, found " + divi);
}
bean.setDIVI(divi);