How to convert Date data type from oracle ( format " 01-JAN-19") in LocalDate data type in Java

Marcel Pirlog :

I try to convert using LocalDate.parse() and dont work. In database all Date are format "01-JAN-19" (dd-mm-yy).

LocalDate.parse(resultSet.getString(5))
Ole V.V. :

Don’t use ResultSet.getString for a date. Since JDBC 4.2 get a LocalDate at once:

resultSet.getObject(5, LocalDate.class)

Note the use of getObject rather than getString or getDate.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=327328&siteId=1