• oracle 插入时间


     insert into test values(1,sysdate); 

    try{
    if(controlSeq==null || "".equals(controlSeq)){
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
    sql.append("insert into OUT_FORM_DATA_INFO (seq,c_id,fm_data_id,user_code,create_date) values (?,?,?,?,to_date(?,'yyyy-MM-dd HH24:mi:ss'))");
    pst = conn.prepareStatement(sql.toString());
    pst.setString(1, getUUIDdwithLendth());
    pst.setString(2,cId);
    System.out.println(getUUIDdwithLendth());
    pst.setString(3, fmDataId);
    pst.setString(4, userCode);
    pst.setString(5, df.format(new Date()));
    int i = pst.executeUpdate();
    if (i>0) successed = CommonUtil.createResponseXML(SysParam.SUCCESS_CODE, "", "");
    }else{
    sql.append("insert into APPR_EXTENDED_XML_DATA (ex_id,control_seq,c_id,fm_data_id,column_name) values (?,?,?,?,?)");
    pst = conn.prepareStatement(sql.toString());
    // pst.setInt(1, getSeq("SEP_TEST", conn));//
    pst.setLong(1, DBManager.getSysSeq("", "APPR_EXTENDED_XML_DATA", "APPR_EXTENDED_XML_DATA"));
    pst.setString(2, controlSeq);
    pst.setString(3,cId);
    pst.setString(4, fmDataId);
    pst.setString(5, collmnName);
    int i = pst.executeUpdate();
    if (i>0) successed = CommonUtil.createResponseXML(SysParam.SUCCESS_CODE, "", "");
    }


    }catch(Exception e){
    successed = CommonUtil.createResponseXML(SysParam.INTERNALSERVER_CODE, "", "");
    System.out.println(
    " saveForm(String controlSeq, String cId, String fmDataId,String collmnName, String userCode,Connection conn)" +
    e.getMessage());
    throw e;
    }finally{
    pst.close();
    }
    return successed;

  • 相关阅读:
    jenkins初始化启动报错导致进入web页面无法安装插件
    redis5.0.7集群搭建
    搭建redis哨兵模式
    Linux服务器安装python3.6
    MySQL绿色版安装
    OSChina中远程GIT仓库同步探索
    Android坡度计
    利用ADB获取APP资源
    实现两台路由器无线桥接
    新体能评定软件开发总结(一)
  • 原文地址:https://www.cnblogs.com/zshboke-2015/p/5026384.html
Copyright © 2020-2023  润新知