日期:2014-05-18 浏览次数:20964 次
DateFormat format=new SimpleDateFormat("yyyy");
Date date=format.parse("2008");
------解决方案--------------------
你为什么要用SQL呢,可以用
SimpleDateFormat format = new SimpleDateFormat("yyyy");
format.parse(rs.getString("日期");
------解决方案--------------------
DateFormat format=new SimpleDateFormat("yyyy");
try {
Date date=format.parse("2008");
} catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}