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);
   }

Convert java.lang.String to oracle.jbo.domain.Date的更多相关文章

  1. Cannot convert value of type [java.lang.String] to required type [java.util.Date] for property 'xxx': no matching editors or conversion strategy found

    今天在完成项目的时候遇到了下面的异常信息: 04-Aug-2014 15:49:27.894 SEVERE [http-apr-8080-exec-5] org.apache.catalina.cor ...

  2. java.lang.ClassCastException: java.lang.String cannot be cast to com.jy.hfims.domain 映射实体类型错误

    今天在做 excel导出的时候,出现了一个问题"java.lang.ClassCastException: java.lang.String cannot be cast to com.do ...

  3. spring mvc出现 Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'endtime'

    在使用spring mvc中,绑定页面传递时间字符串数据给Date类型是出错: Failed to convert property value of type [java.lang.String] ...

  4. 解决spring mvc 上传报错,Field [] isn't an enum value,Failed to convert value of type 'java.lang.String[]' to required type '

    没有选择附件,但是点击上传按钮的时候会报错. 之前不选择文件,直接上传空文件是可以的,后来不知道改了什么就不行了. 错误信息: -- :: [http--] TRACE org.springframe ...

  5. 出错:Failed to convert property value of type 'org.apache.ibatis.session.defaults.DefaultSqlSessionFactory' to required type 'java.lang.String' for property 'sqlSessionFactoryBeanName';

    出错的详细信息: 3 ERROR [http-nio-80-exec-3] org.springframework.web.servlet.DispatcherServlet - Context in ...

  6. Failed to convert value of type 'java.lang.String' to required type 'java.time.LocalDate';

    springboot jdbc查询使用LocalDate报:Failed to convert value of type 'java.lang.String' to required type 'j ...

  7. Cannot convert value of type [java.lang.String] to required type [javax.sql.DataSource] for property 'dataSource': no matching editors or conversion strategy found

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFa ...

  8. 【spring boot】spring boot 前台GET请求,传递时间类型的字符串,后台无法解析,报错:Failed to convert from type [java.lang.String] to type [java.util.Date]

    spring boot 前台GET请求,传递时间类型的字符串,后台无法解析,报错:Failed to convert from type [java.lang.String] to type [jav ...

  9. 【spring mvc】后台API查询接口,get请求,后台Date字段接收前台String类型的时间,报错default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'createDate';

    后台API查询接口,get请求,后台Date字段接收前台String类型的时间筛选条件 后台接口接收 使用的实体 而createDate字段在后台实体中是Date类型 报错信息: org.spring ...

随机推荐

  1. linux 进阶命令笔记(12月26日)

    1. df 指令 作用:查看磁盘空间 用法: #df -h       -h 表示以可读性较高的形式展示大小   2.free 指令 作用:查看内存使用情况 语法:#free -m       -m表 ...

  2. mybatis+spring boot, mapper 提示Could not autowire. No beans of … type found

    工具及背景: IntelliJ IDEA 2016.1.3 Ultimate.spring boot, maven项目,利用mybatis 注解的方式查询mysql. 业务逻辑关系:controlle ...

  3. C#中引用第三方ocx控件引发的问题以及解决办法

    调用OCX控件的步骤:1.在系统中注册该ocx控件,命令:regsvr32.exe 控件位置(加 /u 参数是取消注册)2.在.net的工具箱中添加该控件,拖到form中去就可以了. 不用工具箱的话, ...

  4. [osg]osgcallback各种回调使用的例子介绍

    观察MyReadFileCallback结构体的内容,可以发现它继承自osgDB::Registry::ReadFileCallback,并重载了一个函数readNode,分析源代码可知,该函数在os ...

  5. image以最小边为标准填满正方形父级元素

    需求: 上传图片并实现预览, 图片以最小边为标准填满正方形的父级div,且不变形,且点击可以预览大图. 有两种实现方式: 1.div+img标签, 利用object-fit:cover,据说兼容性不好 ...

  6. python 正则表达式规则收集

    python正则表达式基本元字符 .   通配符,匹配所有字符 ^abc  匹配以abc开始的字符串 abc$  匹配以abc结尾的字符串 [abc]  匹配字符集合 [A-Z0-9] 匹配字符范围 ...

  7. TCP与UDP各自优缺点与区别

    TCP的优点: 可靠,稳定 TCP的可靠体现在TCP在传递数据之前,会有三次握手来建立连接,而且在数据传递时,有确认.窗口.重传.拥塞控制机制,在数据传完后,还会断开连接用来节约系统资源. TCP的缺 ...

  8. 学习笔记14—Python error集

    1.Can't broadcast input array from shape (3,1) into shape (3,) resolution:    V[k:m,k] = v; v has sh ...

  9. node+ts的心得与坑

    首先先明确,用node+ts的目的,为什么不ng+ts.这一点后面还会反复提醒自己 node毕竟不是ng. 用node的理由: 处理js,在后端操纵dom,读写类html格式的东西,比直接用py的后端 ...

  10. (转)Qt中图片相对位置的引用

    原文作者:locky1218 原文地址:https://blog.csdn.net/locky1218/article/details/9749703/   一般使用相对位置的时候可能无法显示图片,可 ...