> 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.*
>

Simple one,

when class names clash you must you fully qualified package names to remove
the ambiguity.

In this instance you MUST use new java.util.Date() OR new java.sql.Date().

I recommend you use the fully qualified package name for those objects you
use the least. In this
case I would use java.util.Date() anyway.

You can still import java.util.*; (you have to anyway to make Date visible)

Hope this helps

Andy Bailey

PS If using dates in a database why not use stored procedures to do things
for you and when inserting into
a table that needs the current date use getdate() to get the database server
date (which is better to use in any case)

You can do this with a PreparedStatement say "update from this_table set
lastaccessed = getdate() where blah = wibble"

The reason you use db server dates is simple, the data is actually landing
at the server then. However I can see many reasons
why you would want to use the web server date as well so this rule above
doesn't always hold true.

___________________________________________________________________________
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