代码:
public void orderSave(Order order) {
Connection conn = null;
PreparedStatement pstmt = null;

SimpleDateFormat format = new SimpleDateFormat("yyyyMMddmmss");
Date date = new Date(System.currentTimeMillis());
String sid = format.format(date);

int id = Integer.parseInt(sid);

try {
conn = DB.getConn();

String sql = "insert into salesorder values (?, ?, ?, ?, ?, ?)";
pstmt = DB.getPstmt(conn, sql);

pstmt.setInt(1, id);
pstmt.setInt(2, order.getUser().getId());
pstmt.setString(3, order.getAddr());
pstmt.setTimestamp(4, order.getODate());
pstmt.setDouble(5, order.getStatus());
pstmt.setDouble(6, order.getTotalprice());
pstmt.executeUpdate();


} catch(SQLException e) {
e.printStackTrace();

} finally {
DB.close(conn);
DB.close(pstmt);
}

}
Mysql数据库结构
+------------+---------------+------+-----+---------+-
| Field      | Type          | Null | Key | Default |
+------------+---------------+------+-----+---------+-
| id         | int(18)       | NO   | PRI | 0       |
| userid     | int(11)       | YES  |     | NULL    |
| addr       | varchar(255)  | YES  |     | NULL    |
| odate      | datetime      | YES  |     | NULL    |
| status     | int(11)       | YES  |     | NULL    |
| totalprice | decimal(18,2) | YES  |     | NULL    |
+------------+---------------+------+-----+---------+-每次提交前后台总是报
java.lang.NumberFormatException: For input string: "201005040119"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
我觉得我已经将他转化成int了,为什么还For input string: "201005040119"
麻烦大家了!!谢谢!!