ELMANDPURAMINE
ELMANDPURAMINE

Reputation: 29

Apache Poi Date value

i try to save type date at my database but i got this error

java.lang.IllegalStateException: Cannot get a NUMERIC value from a STRING cell

this is my code

rfx.setRv_rc_date(row.getCell(67).getDateCellValue());

please what i should to do to get this value format date !

Upvotes: 0

Views: 493

Answers (1)

Kyun
Kyun

Reputation: 61

You are trying to get a Date type value from a String type cell, there are 2 ways you can do:

  1. change the type of the cell in your excel file.
  2. get a String value from the cell in your codes, and then manually format it from String to Date by using SimpleDataFormat or other date formatter.

Upvotes: 1

Related Questions