那你可以用getDate("Date")嘛,干吗要拿getString
getDate以后可以用SimpleDateFormat格式化输出你所指定的格式

解决方案 »

  1.   

    ChDw说得对,用getDate()方法,然后可以再写一个静态函数得到你想要的格式.
    可能需要调用的方法是getYear(),getMonth,getDate..
    不过这几个方法已经是sun不提倡使用的方法了,编译的时候会有Warning.
      

  2.   

    用String的subString()方法提取前面的表示日期的字符段出来
      

  3.   

    getTimestamp
    public Timestamp getTimestamp(int columnIndex)
                           throws SQLException
    Gets the value of a column in the current row as a java.sql.Timestamp object.
    Parameters:
    columnIndex - the first column is 1, the second is 2, ...
    Returns:
    the column value; if the value is SQL NULL, the result is null
    Throws:
    SQLException - if a database access error occurs
    public static String GetDateStr(java.sql.Timestamp rDate, String rDateFormat) {
            SimpleDateFormat lFormat;        lFormat =  new SimpleDateFormat(rDateFormat);
            gRtnStr = lFormat.format(rDate);
     
            return gRtnStr;
        }
      

  4.   

    关于日期
    http://www.csdn.net/develop/article/11/11147.shtm
    http://www.csdn.net/develop/article/11/11145.shtm
      

  5.   

    Yes . But why not modify it before using getXXX method ?
    You may use the DBMS function .