• 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;

  • 相关阅读:
    建造者模式的使用场景
    由于losf引起的pxc启动报错处理
    mysql5.6源码自动安装脚本
    mysql5.7.16二进制安装
    Maven入门
    数据链路层
    图-拓扑排序
    线性表-队列
    线性表-链表
    Java基本概念(未完)
  • 原文地址:https://www.cnblogs.com/zshboke-2015/p/5026384.html
Copyright © 2020-2023  润新知