I want to import my Excel file into MySQL database using Java. I have used Apache POI for this reason. I have one Column named "Mobile Number" that contains 10 digit numeric values (e.g. 9876543210 ). now when i read this value from excel file it gives me like "9.876543210E9".
My code is like this :
In above code. I am checking for the cell value type. for that Mobile number column it gives me type "Numeric Cell Value", so I have to use cell.getNumericCellValue() .
Can anyone please tell me what i should make change to get that numeric values as string.?
You could change the type of that column to string/text in the original Excel spreadsheet. I'm actually surprised that you're seeing the value displayed correctly in Excel if the cell type is numeric; I'd have expected it to use the scientific number format as well.
I'm having the same problem. Have tried formatting the column in the spreadsheet as Text but it makes no difference, calling row.getCell(col1).toString() returns a representation of the number contained by the cell in scientific format regardless.