I am attempting to use a Criteria to select rows from the database where the
restriction clause uses the Date type. I had a look at the code for
Turbine_User as it uses a Date (Turbine_user.created) and it sets the value
using a java.util.Date object. When I try the same thing with the following
code I get a  "ORA-01858: a non numeric character was found where a numeric
was expected" error.

Both startsearchdate and endsearchdate below are of type java.util.Date

                Criteria crit = new Criteria();
            crit.add(RwRetrievalPeer.SCHEDULE_ID,
                     KeyConverter.numberKeyFromInt(scheduleId));
            crit.add(RwRetrievalPeer.TIME_OF_RETRIEVAL,
                     startsearchdate, Criteria.GREATER_THAN);
            Criteria.Criterion criterion =
crit.getCriterion(RwRetrievalPeer.TIME_OF_RETRIEVAL);
            criterion.and(crit.getNewCriterion(
                             criterion.getTable(),
                             criterion.getColumn(),
                             endsearchdate,
                             crit.LESS_EQUAL ));

crit.addAscendingOrderByColumn(RwRetrievalPeer.TIME_OF_RETRIEVAL);
            Vector rwRetrievals = RwRetrievalPeer.doSelect(crit);

any ideas?

David


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to