我使用日期选择器来选择日期格式。现在,将这个日期从 jsp 页面传递到 servlet 页面,而不是传递我输入的 sysdate 正在传递的日期。
Calendar cal = Calendar.getInstance();
String getdate = request.getParameter("selectDate");
String [] date = getdate.split("-");
int date1 = Integer.parseInt(date[0].trim());
int month = Integer.parseInt(date[1].trim());
int year = Integer.parseInt(date[2].trim());
java.sql.Date sD=new java.sql.Date(cal.getTimeInMillis());
System.out.println(sD);
这些是一些系统输出
In Book Support
In Database Connection
Driver is still loading...
Driver Loaded.....
Connection established.....
2013-10-28
support_id=0, booking_date=2013-10-28, descriprtion=asdasd, address=sadas, contact_number=234]
In Add Support
support_id=0, booking_date=2013-10-28, descriprtion=asdasd, address=sadas, contact_number=234]
1record added