java.util.Date可以和java.sql.Date转换的
论坛有这样的帖子,搜一下就可以了顺便帮你up,我也想知道sql.Date和util.Date有什么区别联系

解决方案 »

  1.   

    Date tdate=new Date();
       java.sql.Date date;
       date=new java.sql.Date(tdate.getYear(),tdate.getMonth(),tdate..getDate()) ;
       prestate.setDate(3,date);
      

  2.   

    建议大家看看sun的java doc。那里其实已经写清楚了。
    sql.Date是util.Date的子类。
    util.Date的精度到毫秒。
    这是javadoc的原文:
    The class Date represents a specific instant in time, with millisecond precision.
      

  3.   

    java.sql 
    Class Date
    java.lang.Object
      |
      +--java.util.Date
            |
            +--java.sql.Date
    All Implemented Interfaces: 
    Cloneable, Comparable, Serializable public class Date
    extends DateA thin wrapper around a millisecond value that allows JDBC to identify this as a SQL DATE. A milliseconds value represents the number of milliseconds that have passed since January 1, 1970 00:00:00.000 GMT. To conform with the definition of SQL DATE, the millisecond values wrapped by a java.sql.Date instance must be 'normalized' by setting the hours, minutes, seconds, and milliseconds to zero in the particular time zone with which the instance is associated. 
      

  4.   

    标准的转换方法是:
    java.sql.Date d = new java.sql.Date((new java.util.Date()).getTime());
    对于sun不建议使用的方法,建议大家不要再用了,以便养成良好的编程习惯。