Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ADF: How to cast to oracle.jbo.domain.Date

Apostolos KOct 6 2011 — edited Oct 7 2011
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 4 2011
Added on Oct 6 2011
4 comments
2,978 views