zoukankan      html  css  js  c++  java
  • Convert java.lang.String to oracle.jbo.domain.Date

    https://www.techartifact.com/blogs/2013/09/converting-java-lang-string-to-oracle-jbo-domain-date.html

    tions-

    /**
    *Converts a String to oracle.jbo.domain.Date
    * @param String
    * @return oracle.jbo.domain.Date
    */
    public oracle.jbo.domain.Date castToJBODate(String aDate){
              DateFormat formatter;
              java.util.Date date;
     
              if(aDate!=null){
     
                try {
     
                  formatter = new SimpleDateFormat("dd/MMM/yyyy");
                  date = formatter.parse(aDate);
                  java.sql.Date sqlDate = new java.sql.Date(date.getTime());
                  oracle.jbo.domain.Date jboDate = new oracle.jbo.domain.Date(sqlDate);
     
                    return jboDate;
                   } catch (ParseException e) {
     
                            e.printStackTrace();
                    }
     
             }
     
             return null;
    }

    Another scenario –Convert oracle.jbo.domain.Date to String

    Use this code-

    public String convertJbodateToString(oracle.jbo.domain.Date domainDate){
            
           SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S"); 
           Date date = null;
            
           try {
               date = formatter.parse(domainDate.toString().substring(0, 21));
           } catch (ParseException e) {
           }
            
                    
           SimpleDateFormat FORMATTER = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
           System.out.println("NewDate-->" + FORMATTER.format(date));
            
           return FORMATTER.format(date);
       }
  • 相关阅读:
    下载android的linux内核的方法
    安装sunjava5jdk 提示"无法找到软件包sunjava5jdk
    Linux kernel中的annotation(转)
    2012年计划
    Android 开机图片/文字/动画的修改(转)
    2.6 内核中的计时器和列表
    linux设置默认网关
    谷歌Android被Linux内核除名(转)
    使用call_usermodehelper在Linux内核中直接运行用户空间程序(转)
    S3C2410平台上运行为例,讲解内核的解压过程
  • 原文地址:https://www.cnblogs.com/huanghongbo/p/8250957.html
Copyright © 2011-2022 走看看