首先,写日期到数据库中绝对不应该使用字符串,这个是最差的一个方法,除非没有其它办法才应该使用
应该使用的是
PreparedStatement prep = conn.prepareStatement("insert into tableA values(?,?)");
prep.setTimestamp(1, new Timestamp(System.currentTimeMillis()));
...
prep.executeUpdate();