Subject | Re: [Firebird-Java] Re: How to retrieve a value from a Date field of a ResultSet |
---|---|
Author | Roman Rokytskyy |
Post date | 2006-05-24T08:41:20Z |
> However, I hope you'll still look at my question again. You say IYou can't obtain Calendar from ResultSet object. You should use Calendar the
> should use Calendar. That's exactly what I want! But how do I do
> this in this context? AFAIK, ResultSet hasn't got a method
> getCalendar - only a method getDate. So, how do I obtain a Calendar
> object with the date stored in a ResultSet's field? TIA
same way you do this in normal applications:
Calendar calendar = Calendar.getInstance();
calendar.setTime(rs.getDate(2));
int year = calendar.get(Calendar.YEAR);
...
Some care should be taken with time zones...
Roman