I have a field in the MySQL database Date type and inside a modelPie.set(String, number)
function I want to bring this field but java says it can not convert from Date
to Number
.
I have a field in the MySQL database Date type and inside a modelPie.set(String, number)
function I want to bring this field but java says it can not convert from Date
to Number
.
Friend the question is quite incomplete, but I will try to respond objectively.
Java does not do implicit conversion, just in case of inheritance. As the number and date class is unrelated, it really does.
Use the getTime method of class Date
.
modelPie.set("Nome", data.getTime());