I am using JPA. I have a simple native query on some columns. One of them, named CreateDate
, is in timeStamp format. When I run the native query, I get an Object[]
in which createDate
appears in char[]
format. Is there any way to have the returned char[]
for createDate
in Java LocalDateTime
or Date
format?
Asked
Active
Viewed 661 times
0

Ole V.V.
- 81,772
- 15
- 137
- 161

Mehdi Mohammadi
- 1
- 1
-
2show the code you are having trouble with. – Scary Wombat May 24 '17 at 04:18
-
You can convert it manually. Post `char[] createDate` returned from db – Jay Smith May 24 '17 at 04:33
-
I can parse char[] to date, but i afraid what if someone changes db config so returned apearance of timestamp changes and my parser won't work. is this valid issue? – Mehdi Mohammadi May 24 '17 at 04:52
-
Thanks,answer is: LocalDateTime localDateTime = LocalDateTime.parse(o[1].toString()); where o[1] is my returned object ,char[], from db – Mehdi Mohammadi May 28 '17 at 10:17