|
It is recommended to use sysdate, not getdate ()
The following is the original code of jsp for reference
String sqlStr = "insert into" + tableName
+ "(name, age, height, add_date) values (?,?,?, to_char (sysdate, 'YYYY-MM-DD HH24: MI: SS'))";
pstmt = con.prepareStatement (sqlStr);
pstmt.setString (1, client.getName ());
pstmt.setInt (2, client.getAge ());
pstmt.setInt (3, client.getHeight ());
//pstst.setString(4,sysdate);
pstmt.executeUpdate (); |
|