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. 2、ansilbe常用模块详解及inventory介绍

    Ansible ansible格式: ansible <host-pattern> [-f forks] [-m module_name] [-a args] args: 用法 key=v ...

  2. [0403]学习一个——苟(简单Java开发)

    学习一个--苟 1. 开发目的 拜读了某神犇的blog,感到了自身深深的不足.蒟蒻如我,决定提高一蛤自身的姿势水平,学习一个,使用Java重写用GreatestLanguage写的某小说网站的抓取器. ...

  3. 爬虫系列之BeautifulSoup

    BeautifulSoup是处理爬虫的一个强大工具,在HTML页面中,是由各种标签构成的,BeautifulSoup的功能就是从标签下手的,它是解析.遍历.维护“标签树”的功能库. Beautiful ...

  4. CSU 2005 Nearest Maintenance Point(最短路+bitset)

    https://vjudge.net/problem/CSU-2005 题意:给出带权值的图,图上有一些特殊点,现在给出q个询问,对于每个询问,输出离该点最近的特殊点,如果有多个,则按升序输出. 思路 ...

  5. Go 字典(Map)

    比较熟悉 Python 的对于字典肯定不会陌生,在 Go 中 map 就是 Python 中字典的概念,它的基本格式是 map[keyType]valueType .map 的读取和设置和 slice ...

  6. Codeforces 785 D. Anton and School - 2

    题目链接:http://codeforces.com/contest/785/problem/D 我们可以枚举分界点,易知分界点左边和右边分别有多少个左括号和右括号,为了不计算重复我们强制要求选择分界 ...

  7. Linux硬盘分区满,但没有找到占用文件

    原因查找: 此服务器上有写日志的操作,在写的同时我把要写入的文件删除了..因为在写操作不能创建文件的时候会写硬盘的block,这样会使硬盘利用率越来越低,可以使用lsof -n |grep delet ...

  8. kafka+docker+python

    昨天晚上刚刚才花3小时看完<日志:每个软件工程师都应该知道的有关实时数据的统一概念>. 今天就把kafka在docker容器里运行起来,github上有几个,但都太复杂了. 我自己写个最简 ...

  9. [C#]获取指定文件夹下的所有文件名(递归)

    典型的递归方法: //定义一个list集合 List<String> list = new List<String>(); public void director(strin ...

  10. mui 访问系统相册将图片显示到网页

    访问系统相返回值为一个对象,通过转换为字符串可以查看,path.files[0]为返回路径去除路径赋值到src 调用摄像头返回的相片的path为一个路径通过 plus.io.resolveLocalF ...