tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Darren Lee Deliang" <>
Subject RE: Indexed Properties and Resultset
Date Tue, 04 Jul 2000 11:34:12 GMT
Hi, I solved the problems already, but my logic is abit long winded. I 
created a timestamp obj of the current date and used it to compare the 
attribute in my db which is a datetime and in jdbc conversion terms is a  

to create that current timestamp i have to create a Date obj in the first 
place to get the year, date etc cuz the constructor for it needs these as 
input parameters first. (there is no new Timestamp(); instead it is new 
Timestamp(int year, int date etc))

One thing is that i cant seem to convert the timestamp value retrieved 
properly to Date . This is how my logic flow:

Retrieve Timestamp -> convert to Date -> convert to String

String is OK just that i cannot seem to convert to date (i only want the 
day, month and year, not the GMT and time) maybe the instance method I used 
is not the rite one.

Anyway thanks for all your help.

BTW yo think it is possible to use jsp to convert a set of values i got from 
db to a excel file in JSP?

Nanyang Polytechnic

>From: "Rob S." <>
>To: <>
>Subject: RE: Indexed Properties and Resultset
>Date: Sun, 2 Jul 2000 23:06:08 -0700
> >   String SQLstatement = "SELECT courseNo, courseTitle, coursestartDate,
> > courseendDate, courseDeadline FROM Course WHERE courseDeadline < ?";
> >     st.setDate(1, new java.util.Date());
>I think a previous emailed mentioned it was of type timestamp (in the
>database).  Here you're using st.setDate instead of something probably like
>W/out ever having looked at this stuff, I'm *guessing* the call should be
>something like
>st.setTimestamp( 1, new java.sql.Timestamp(???) );
>Shot-in-the-dark on a Sunday nite when I'm tired =)
>Hope it helps or at least gets you on the right track!
>- r
>To unsubscribe, email:
>For additional commmands, email:

Get Your Private, Free E-mail from MSN Hotmail at

View raw message