Hello,
You have to specify either 'java.util.Date' or 'java.sql.Date' in each
declaration and call the 'new' operator. The 'import' statement makes
UN-ambiguous class references acceptable via shorthand - it is always
correct, and sometimes required, to use the fully qualified package+class
name.
It sounds like you want the java.util.Date specifically; if so, fine.
but you should understand what is different in java.sql.Date (which is a
subclass of java.util.Date) to see if it has features that you want.
regards,
-- Bill
At 08:52 AM 6/7/99 +0930, you wrote:
>Hi all
>
>my Servlet uses JDBC and I want to use java.util.Date but
>
>when I have
>
>import java.sql.*;
>import java.util.*;
>
>and use Date rightnow = new Date();
>
>I get the error
>
>Error: (67) reference to Date is ambiguous; both class java.util.Date in
>package
>java.util and class java.sql.Date in package java.sql match
>
>how do I get it to use the java.util.Date class without specifying all the
>java.sql.* classes
>individually.
>
>thanks for any help
>
>Alan Boldock
>The University of Adelaide
>
>
>
>------------------------------------------------------------
>To subscribe: [EMAIL PROTECTED]
>To unsubscribe: [EMAIL PROTECTED]
>Problems?: [EMAIL PROTECTED]
>
>
>
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]