You can also say:

import java.sql.*;
import java.util.*;
import java.util.Date;

Date date = getDate(...)

(*Chris*)


----- Original Message -----
From: "Chen, Gin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 31, 2001 10:11 AM
Subject: Re: [JSP-INTEREST] Date() giving problems in jsp


> Hey,
>         I've actually had the same problem a few times already :-P I dont
> know why Java creators decided on having different packages for dates. But
> the solution is actually pretty simple.
>         I'm guessing that you probably put
>
>         import java.util.*;
>         import java.sql.*;
>
>         in ur header. That is the main issue there. IF that is a code
> standard for ur company then you have to actually specify the type of
dates.
> So ur code will look like:
> java.sql.Date startdate = java.sql.Date() depending on what date ur
actually
> using.
>         Another minor note: request.getParameter("date") will return a
> java.lang.String object. Last time I checked.. you cant assign that to a
> Date object of any package.
>
> Hope that helps,
> -Tim
>
> -----Original Message-----
> From: charu gupta [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 31, 2001 1:05 PM
> To: [EMAIL PROTECTED]
> Subject: Date() giving problems in jsp
>
>
> Hi all,
>
> In my jsp page I am passing "date" as a parameter.
>
> The code is as follows:-
> Date startdate=Date();
> if(request.getParameter("date")!=null)
>         {
>            startdate=request.getParameter("date");
>         }
>
> I am getting the following error message on
> compilation:-
>
>
D:\bea\wlserver6.0\config\EAIDOMAIN\applications\emd\WEB-INF\_tmp_war_EAI1_E
> AI1_EMD\jsp_servlet\_test2.java:169:
> reference to Date is ambiguous, both class
> java.sql.Date in java.sql and class java.util.Date in
> java.util match
>             Date startdate= new java.util.Date(); //[
> /test2.jsp; Line: 10]
>
>
> Please help!
> Thanks
>
>
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to