源码:
public ResultSet getAnnalByDay(String table, String column, String value) {
    ResultSet rset = null;
    Statement stmt = null;
//    String sql = "select * from " + table + " where " + column + "=to_date("
//       + value + ",'yyyy-mm-dd')";
    String sql = "select * from " + table + " where trunc(" + column + ")=to_date("
         + value + ",'yyyy-mm-dd')";
    Connection con = getCommonConnection();
    try {
      stmt = con.createStatement();
      rset = stmt.executeQuery(sql);
    } catch (SQLException e) {
      e.printStackTrace();
    }
    return rset;
  }
调用:
getAnnalByDay("saled_wgw","outdate","2007-12-17");
报的异常:
java.sql.SQLException: ORA-01840: 输入值对于日期格式不够长
PS:很郁闷呀..找了半天还是找不到哪出了问题呀,哪位高手指点下哈