tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Darren Lee Deliang" <just_dar...@hotmail.com>
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  
timestamp.

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?

Darren
Nanyang Polytechnic
Singapore


>From: "Rob S." <rslifka@home.com>
>Reply-To: tomcat-user@jakarta.apache.org
>To: <tomcat-user@jakarta.apache.org>
>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 < ?";
>
>[snip!]
>
> >     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
>setTimestamp?
>
>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: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commmands, email: tomcat-user-help@jakarta.apache.org
>

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


Mime
View raw message