Looks like it's a problem with how Scarab is calling Oracle. I would look
at the scarab code to find where this is being called. It might be getting
the date in the default format of the machine.
Looks like it's at this point.
org.tigris.scarab.om.ScarabUserImpl.isPasswordExpired(ScarabUserImpl.java:59
6)
Here's the code:
Criteria crit = new Criteria();
crit.add(UserPreferencePeer.USER_ID, userid);
Calendar cal = Calendar.getInstance();
crit.add(UserPreferencePeer.PASSWORD_EXPIRE, cal.getTime() ,
Criteria.LESS_THAN);
List result = UserPreferencePeer.doSelect(crit);
Here is the Date.toString() which looks like it's returning the default
format below.
if (formatter == null) {
/* No cache yet, or cached formatter GC'd */
formatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy",
Locale.US);
simpleFormatter = new SoftReference(formatter);
}
There's no way that Oracle will be able to format that. I'm not sure how
other databases would either. In DBOracle, all is does is puts the above
string into the TO_DATE function. I always pass a formated date to the
criteria object, but I know what db I'll be using. ( I hope... ;-) ).
-----Original Message-----
From: Eric Dobbs [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 14, 2002 10:44 AM
To: Turbine Users List
Subject: Re: Problem while constructing sql select statement in
org.apache.torque.util.BasePeer.java
On Thursday, March 14, 2002, at 05:02 AM, Lalita P wrote:
> We found the statement below logged in torque.log file.
> 2002-03-14 15:55:24,360 [HttpProcessor[8000][4]] DEBUG
> org.apache.torque.util.BasePeer - SELECT
> SCARAB_USER_PREFERENCE.USER_ID, SCARAB_USER_PREFERENCE.PASSWORD_EXPIRE
> FROM SCARAB_USER_PREFERENCE WHERE (SCARAB_USER_PREFERE
> NCE.USER_ID=200) AND
> (SCARAB_USER_PREFERENCE.PASSWORD_EXPIRE<TO_DATE('Thu Mar 14 15:55:24
> GMT+05:30 2002', 'yyyy-mm-dd hh24:mi:ss..' ))
TO_DATE('Thu Mar 14 15:55:24 GMT+05:30 2002', 'yyyy-mm-dd hh24:mi:ss..' )
The date value you are supplying ('Thu Mar 14 15:55:24 GMT+05:30 2002')
does not fit the format you are trying to use ('yyyy-mm-dd
hh24:mi:ss..').
It would be hard to find any algorithm that can convert 'Thu' into a four
digit year. 8^)
-Eric
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>