> Sorry to disturb u again..
>
> That Date() comes under util.* but, since I have included Java.sql.*, It
is giving
> compilation error, like no
> constructor matching the Date() .If I include util.*, then agin the
problem.
>
> So, I need the same Date() under ..java.sql.*
>
> -wilson
>
Hi,

Simply make sure you use java.sql.Date() for sql dates and java.util.Date()
for normal ones.
You can use the fully qualified package names to remove ambiguities
(wonderful things packages).

EG

java.util.Date now = new java.util.Date();

java.sql.Date() dbnow = new java.sql.Date(System.currentTimeMillis());

you only need to use the fully qualified path name when declaring and
creating objects

Try to say dbnow = now will break (wrong class type) however you can do
operations like
dbnow.toString() and now.toString() without any further worries.

Hope that helps

Andy Bailey

PS Don't forget you still have to import java.sql.* and java.util.*

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to