ADF: How to cast to oracle.jbo.domain.Date
Hello everyone!!
In the implementation of an AM, I have the following code:
String sqlStr = " select max(journal_date) MAX_JOURNAL_DATE from wmbatchjournal ";
This returns date in sql.
Then, I want to get the returned value and pass it in parameter value, like below:
try {
vo = this.createViewObjectFromQueryStmt("SQLvo", sqlStr);
vo.executeQuery();
if (vo.hasNext()){
Row row = vo.next();
d = (oracle.jbo.domain.Date)row.getAttribute("MAX_JOURNAL_DATE"));
} else {
throw new JboException("No data was found !!");
}
}
finally {
vo.remove();
}
parametersRow.setEvalDate(new oracle.jbo.domain.Date(d));
Variable "d" is declared as oracle.jbo.domain.Date and this is the problem!
At run-time I get the error: java.lang.ClassCastException: oracle.jbo.domain.Date cannot be cast to java.sql.Date
Any help is welcome!!! Please be as analytical as possible because I'm newbei...
Thanks a lot
Edited by: apostolosk on Oct 6, 2011 5:20 AM