第2个回答 2011-02-25
JSP处理页面(将字符串转成日期):
String dateStr = request.getParameter("birthday"); //获取页面传递过来的日期字符串
DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
Date birthday= sdf.parse(dateStr);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println("birthday:" + sdf.format(birthday));
=============或者用oracle的日期函数转型后直接存入 数据库===================
String dateStr = request.getPrameter("birthday"); //获取页面传递过来的日期字符串
String sql = "insert int to table_a birthday values(to_date(dateStr ,'yyyy-MM-dd'))";本回答被提问者采纳