存储timestamp的数据类型到数据库中的几行代码

来源:互联网 发布:淘宝网触屏版首页登录 编辑:程序博客网 时间:2024/05/18 00:19
yiz :  http://www.yiz.name

表1183163_logs 中的字段crt_time为timestamp类型。

       //*****************插入log=================
         PreparedStatement pstmt=conn.prepareStatement("INSERT INTO 1183163_logs (tel,crt_time)VALUES(?,?)");
         pstmt.setString(1,callerId);
         pstmt.setTimestamp(2,new java.sql.Timestamp(new java.util.Date().getTime()));
         pstmt.executeUpdate();
       //=================插入log**************

原创粉丝点击