db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Fedorenko" <afedo...@informex.net>
Subject addDate garbage
Date Thu, 19 Jun 2003 14:55:57 GMT
Hello

I use 

//

Calendar cal = Calendar.getInstance(locale) ;

selectCriteria.addDate(TranPeer.TRANS_TIME,
                             cal.get(Calendar.YEAR),
                             cal.get(Calendar.MONTH),
                             cal.get(Calendar.DAY_OF_MONTH),
                             Criteria.EQUAL);
//

... and resulting query is 

SELECT TRAN.TRAN_ID, TRAN.OP_TYPE, ... FROM TRAN WHERE
TRAN.TRANS_TIME=java.util.GregorianCalendar[time=?,areFieldsSet=false,ar
eAllFieldsSet=false,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Eur
ope/Kiev",offset=7200000,dstSavings=3600000,useDaylight=true,transitions
=119,lastRule=java.util.SimpleTimeZone[id=Europe/Kiev,offset=7200000,dst
Savings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,st
artDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,e
ndMonth=9,endDay=endDayOfWeek=1,endTime=3600000,endTimeMode=2]],firstDay
OfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2003,MONTH=5,WEEK_OF_YEAR=?
,WEEK_OF_MONTH=?,DAY_OF_MONTH=12,DAY_OF_YEAR=?,DAY_OF_WEEK=?,DAY_OF_WEEK
_IN_MONTH=?,AM_PM=?,HOUR=?,HOUR_OF_DAY=?,MINUTE=?,SECOND=?,MILLISECOND=?
,ZONE_OFFSET=?,DST_OFFSET=?] ORDER BY TRAN.TRAN_ID ASC LIMIT 10


What is the right way to work with TIMESTAMP fields in database ?

Thank you.



Mime
View raw message