Oracle.jbo.domain.Number / Date comparable ?

Hello,
I'd like to know whether there was a plan to make the oracle.jbo.domain.Number and oracle.jbo.domain.Date classes implement the Comparable interface?
That would save some unnecessary wrapping code...
Thanks in advance,
Remi

I just want to push this Idea, since it is hard to understand, why such a simple interface is not implemented for such a basic class. It would make a lot of things much easier.

Similar Messages

  • Oracle.jbo.domain.Number; local class incompatible

    Hi Forum,
    Development Tool     : Jdeveloper 9.0.4 (part of Oracle 10g Suite)
    Target Application Summary:
    A simple application which displays the content of a database table and allows it to be modified both through a web interface as well as a Swing standalone client.
    A Workspace having three projects:
    1) A Business layer defined by using BC4J(Business Components For Java) provided with Jdeveloper 10g.
    2) A Swing/JClient application for BC4J which accesses the BCJ4 layer using a Business component client data model.
    3)A JSP application using JSP for business components which accesses the BC4j layer
    Target Deployment:
    1) Light-weight swing interface at machine 1
    2) Business components and JSP part in an application server on Machine 2
    3) Oracle DB on Machine3
    Problem Statement
    We deployed the BC4J Middle tier on OC4J standalone as a session bean. Then the client jar was deployed as a remote application(using Swing/JClient for business componments), the following error comes:
    (oracle.jbo.PiggybackException) JBO-28300: Piggyback read error
    ----- LEVEL 1: DETAIL 0 -----
    (java.io.InvalidClassException) oracle.jbo.domain.Number; local class incompatible: stream classdesc serialVersionUID = -6507359405709672486, local class serialVersionUID = -592084144037230518
    Can the forum help me with the problem (i am using the library BC4JOracleDomains which has oracle.jbo.domain.Number class)
    Thanking you in advance.

    Firstly, good job on describing your problem/situation. Some people just don't bother to be verbose.
    Secondly, I have to note that I don't do any development in this way so I have no 1st hand experience with this excpetion. But, it appears as though you are using different versions of the jar files (which in turn contain different versions of the classes). Maybe you should take a look at that?

  • Urgent: oracle.jbo.domain.Number Bug (continued)

    Dear Shailesh(JDeveloper Team):
    To catch your attention, I posted the topic here again:
    [original topic]
    We are developing a BC4J application for our US customer. Our web server (iAS) and database (Oracle 8i) are installed on RS/6000, AIX 4.3.3
    When we try to set a Number type field value (Number is the only type in Oracle database to stand for a number, either a float field or sequence number). On AIX iAS, if the value is integer, larger than 100 and is not multiple of 100 ( such as 123, 112, 5676, 43435 ), the system(ont our jsp, web bean, but handled by low level classes) will automatically add two zeroes at the end of the number before insert to database table. For example:
    123---->12300
    112---->11200
    5676--->567600
    43435-->4343500.
    It is incorrect! On the other hand, when we try to retrieve value from a field which type is Number, if the value is a integer but larger than 100, and is not multiple of 100 ( such as 123, 112, 5676, 43435 ), the system will automatically add two zeroes at the end of the number after got from database table. For example:
    123---->12300
    112---->11200
    5676--->567600
    43435-->4343500
    We check the xml file of the BC4J, Number field type in the middle-tier is denoted as oracl.jbo.domain.Number, so we wrote a program (JSP) without accessing database, like this one:
    <%
    for (int i=0 ; i<1000; i++) {
    %>
    <p> <%=new oracle.jbo.domain.Number(i).toString() %></p>
    <%}%
    The program runs correctly in JDeveloper developing environment on NT workstation( in the developing environment, NT mimic a local virtual middle-tier):
    0
    1
    99
    100
    101
    598
    599
    600
    999
    But after we deployed the jsp to iAS on RS/6000 and browse it, the output result is very inconceivable:
    0
    1
    99
    100
    10100 (Should be 101)
    59800 (Should be 598)
    59900 (Should be 599)
    600
    99900 (Should be 999)
    We checked all through the deployed Jar files on iAS and the oracl.jbo.domain.Number class, we found that the class is extended from oracle.sql.NUMBER, and the toString method is also inherited from oracle.sql.NUMBER.
    We even test below simple jsp program using oracl.jbo.domain.Number type:
    <%@ page contentType="text/html" autoFlush="true" import="java.lang.*,LocaMotion.*"%>
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
    <META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
    <TITLE>
    Hello World
    </TITLE>
    </HEAD>
    <BODY>
    <%
    String strI="123";
    %>
    <p> <%=new oracle.jbo.domain.Number(strI)%></p>
    </BODY>
    </HTML>
    In JDeveloper developing environment, it prints 123 in browser, but when deployed to iAS, it prints 12300.
    Why the same Java class has different behavior under different OS (NT and RS/6000)? We think it is a bug on implementation of oracle.sql.NUMBER. We assume this is caused by the machine CPU register length: NT: 32 bits, RS/6000: 64 bits.
    This bug must be fixed to ensure the BC4J application workable. Would you please resolve this problem for us at your time?
    We are eager to waiting for your answer, as we are in FVT phase, our customer is BITCO enterprises inc. in Virginia.
    Thanks,
    [Answer from Shailesh(JDeveloper Team)]:
    I'd suspect this is an issue in oracle.sql.NUMBER implementation. Could you help us by verifying that oracle.sql.NUMBER.toString() also reproduces the same problem. A potential fix I could think of is to use the jdbc libraries that come with RS/6000-AIX version of the database.
    [Our test result]:
    We test the oracle.sql.NUMBER.toString() method, it also reproduces the same problem.
    What's the "jdbc libraries that come with RS/6000-AIX version of the database"?
    ,who offer it? IBM or Oracle. Where could I find it and how to use it? Will oracle.sql.NUMBER problem for AIX fixed?
    null

    As a follow up , could you tell the specific database version of Oracle8i you are using.(i.e 8.1.6 or 8.1.7/ also if you have applied any patches)
    . Just wondering if you had tried a simple JDBC program (without BC4J) (eg: a command line program) which uses oracle.sql.Number and produced the same erroneous results.
    appericiate if you could provide any additional information.
    thanks and best regards
    raghu

  • Urgent: oracle.jbo.domain.Number Bug (continued I)

    Dear Shailesh and Raghu (JDeveloper Team):
    To catch your attention, I posted the topic here again:
    ------------------------------------------------------------------------------------------[original topic]
    We are developing a BC4J application for our US customer. Our web server (iAS) and database (Oracle 8i) are installed on RS/6000, AIX 4.3.3
    When we try to set a Number type field value (Number is the only type in Oracle database to stand for a number, either a float field or sequence number). On AIX iAS, if the value is integer, larger than 100 and is not multiple of 100 ( such as 123, 112, 5676, 43435 ), the system(ont our jsp, web bean, but handled by low level classes) will automatically add two zeroes at the end of the number before insert to database table. For example:
    123---->12300
    112---->11200
    5676--->567600
    43435-->4343500.
    It is incorrect! On the other hand, when we try to retrieve value from a field which type is Number, if the value is a integer but larger than 100, and is not multiple of 100 ( such as 123, 112, 5676, 43435 ), the system will automatically add two zeroes at the end of the number after got from database table. For example:
    123---->12300
    112---->11200
    5676--->567600
    43435-->4343500
    We check the xml file of the BC4J, Number field type in the middle-tier is denoted as oracl.jbo.domain.Number, so we wrote a program (JSP) without accessing database, like this one:
    <%
    for (int i=0 ; i<1000; i++) {
    %>
    <p> <%=new oracle.jbo.domain.Number(i).toString() %></p>
    <%}%
    The program runs correctly in JDeveloper developing environment on NT workstation( in the developing environment, NT mimic a local virtual middle-tier):
    0
    1
    99
    100
    101
    598
    599
    600
    999
    But after we deployed the jsp to iAS on RS/6000 and browse it, the output result is very inconceivable:
    0
    1
    99
    100
    10100 (Should be 101)
    59800 (Should be 598)
    59900 (Should be 599)
    600
    99900 (Should be 999)
    We checked all through the deployed Jar files on iAS and the oracl.jbo.domain.Number class, we found that the class is extended from oracle.sql.NUMBER, and the toString method is also inherited from oracle.sql.NUMBER.
    We even test below simple jsp program using oracl.jbo.domain.Number type:
    <%@ page contentType="text/html" autoFlush="true" import="java.lang.*,LocaMotion.*"%>
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
    <META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
    <TITLE>
    Hello World
    </TITLE>
    </HEAD>
    <BODY>
    <%
    String strI="123";
    %>
    <p> <%=new oracle.jbo.domain.Number(strI)%></p>
    </BODY>
    </HTML>
    In JDeveloper developing environment, it prints 123 in browser, but when deployed to iAS, it prints 12300.
    Why the same Java class has different behavior under different OS (NT and RS/6000)? We think it is a bug on implementation of oracle.sql.NUMBER. We assume this is caused by the machine CPU register length: NT: 32 bits, RS/6000: 64 bits.
    This bug must be fixed to ensure the BC4J application workable. Would you please resolve this problem for us at your time?
    We are eager to waiting for your answer, as we are in FVT phase, our customer is BITCO enterprises inc. in Virginia.
    Thanks,
    [Answer from Shailesh(JDeveloper Team)]:
    I'd suspect this is an issue in oracle.sql.NUMBER implementation. Could you help us by verifying that oracle.sql.NUMBER.toString() also reproduces the same problem. A potential fix I could think of is to use the jdbc libraries that come with RS/6000-AIX version of the database.
    [Our test result]:
    We test the oracle.sql.NUMBER.t oString() method, it also reproduces the same problem.
    What's the "jdbc libraries that come with RS/6000-AIX version of the database"?
    ,who offer it? IBM or Oracle. Where could I find it and how to use it? Will oracle.sql.NUMBER problem for AIX fixed?
    [Answer from Raghu(JDeveloper Team)]:
    JDev Team
    unregistered posted January 04, 2001 10:14 AM
    Hi
    we are trying to follow up internally on this. Did you file a bug with Oracle Support on this. ?
    If not I would suggest to do that, but at the same time we would be following up on that with the respecitive product group which works on that.
    thanks and best regards
    raghu
    IP: Logged
    JDev Team
    unregistered posted January 04, 2001 04:08 PM
    As a follow up , could you tell the specific database version of Oracle8i you are using.(i.e 8.1.6 or 8.1.7/ also if you have applied any patches)
    . Just wondering if you had tried a simple JDBC program (without BC4J) (eg: a command line program) which uses oracle.sql.Number and produced the same erroneous results.
    appericiate if you could provide any additional information.
    thanks and best regards
    raghu
    Larry's answer:
    Yes. We opened a Tar on http://metalink.oracle.com (Tar number is 1350841.999), but still no solution provided.
    Our software platform is AIX 4.3.3., Oracle 8i is 8.1.6, iAS is 1.0.
    Below program is a very simple Jsp that uses oracle.sql.NUMBER but no BC4J classed used.
    <%@ page contentType="text/html" autoFlush="true" import="java.lang.*,oracle.sql.*"%>
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
    <META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
    <TITLE>
    Hello World
    </TITLE>
    </HEAD>
    <BODY>
    <%
    String strI="123";
    %>
    <p> <%=new oracle.sql.NUMBER(strI).stringValue()%></p>
    </BODY>
    </HTML>
    In JDeveloper developing environment (WINDOWS NT), it prints 123 in browser, but when deployed to iAS on AIX, it prints 12300.
    null

    thanks for the extra information. We have passed the information to specific product group and they are looking into it.
    As it looks like specific issue we can take this offline.
    can you send your email id [email protected]
    and we can let you know on the status.
    raghu

  • Oracle.jbo.domain.Number to int and back

    I have a database field that comes back as a oracle.jbo.domain.Number.
    I want to increment this by one so was trying to convert it to an int, apply the increment then turn it back into a number.
    2 questions :
    1) Can I increment oracle.jbo.domain.Number directly
    2) If not how to I turn it to an int and back
    Many thanks,
    Richard

    Convert oracle.jbo.domain.Number to int with the intValue method.
    oracle.jbo.domain.Number var;
    int intValue=var.intValue();Convert int to oracle.jbo.domain.Number with the Number (int value) constructor.
    int intValue;
    oracle.jbo.domain.Number var=new oracle.jbo.domain.Number(intValue);

  • Strange Bug in oracle.jbo.domain.Number

    Hi
    There is a strange Bug in oracle.jbo.domain.Number. Look at the following code:
    System.out.println(new Number("12E4"));In JDeveloper 9.0.5.3 this code prints
    12000which is correct. In JDeveloper 10.1.3 this code throws an exception:
    java.lang.NumberFormatException: For input string: "E4"
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
         at java.lang.Integer.parseInt(Integer.java:447)
         at java.lang.Integer.parseInt(Integer.java:497)
         at oracle.sql.NUMBER.toBytes(NUMBER.java:1861)
         at oracle.sql.NUMBER.stringToBytes(NUMBER.java:3398)
         at oracle.sql.NUMBER.<init>(NUMBER.java:277)
         at oracle.jbo.domain.Number.<init>(Number.java:289)
         at project1.Main.main(Main.java:10)I think this is a serious bug since some very basic behaviour is not working as expected anymore.

    It's a bug.
    The parseInt method is called and from its javadoc it's clear that it throws a NumberFormatException:
    Parses the string argument as a signed decimal integer. The characters in the string must all be decimal digits, except that the first character may be an ASCII minus sign '-' ('\u002D') to indicate a negative value. The resulting integer value is returned, exactly as if the argument and the radix 10 were given as arguments to the parseInt(java.lang.String, int) method.
    Maybe the earlier implementation of oracle.jbo.domain.Number didn't use the parseInt method.
    Ronald

  • PL/SQL Object Type - Java oracle.jbo.domain

    PL/SQL Object Type <-> Java oracle.jbo.domain
    can anybody help me, getting my domains to work?
    Following scenario:
    in pl/sql we have an object type called MULTI_LANGUAGE. This type is used for storing multilingual texts as nested table in one(!) column.
    So the object MULTI_LANGUAGE contains a member variable LANGUAGE_COLLECTION of type LANGUAGE_TABLE, which itself is a nested table of objects
    of the type LANGUAGE_FIELD (this again is only a language id and the corresponding content)
    Also the methods setContent(langID, langContent) and getContent(langId) are defined on Object MULTI_LANGUAGE.
    For example: Table having primary key, 2 other columns and one column of object type MULTI_LANGAGE (=nested table of objects)
    |ID|Column1|Column2|  multilingual Column  |
    |--|---------------------------------------|
    |  |       |       |  -------------------  |
    |  |       |       | | 1 | hello         | |
    |  |       |       |  -------------------  |
    |1 | foo   | bar   | | 2 | hallo         | |   <- Row Nr 1
    |  |       |       |  -------------------  |
    |  |       |       | | 3 | ola           | |
    |  |       |       |  -------------------  |
    |--|-------|-------|-----------------------|
    |  |       |       |  -------------------  |
    |  |       |       | | 1 | world         | |
    |  |       |       |  -------------------  |
    |2 | abc   | def   | | 2 | welt          | |   <- Row Nr 2
    |  |       |       |  -------------------  |
    |  |       |       | | 3 | ???  ;-)      | |
    |  |       |       |  -------------------  |
    |--|-------|-------|-----------------------|Now i've tried to modell this structure as an oracle.jbo.domain.
    class MultiLanguage extends Struct having this StructureDef:
    attrs[(0)] = new DomainAttributeDef("LanguageColl", "LANGUAGE_COLL", 0, oracle.jbo.domain.Array.class, 2003, "ARRAY", -127, 0, false, "campusonlinepkg.common.LanguageField");
    and
    class LanguageField extends Struct having this StructureDef:
    attrs[(0)] = new DomainAttributeDef("Id", "ID", 0, oracle.jbo.domain.Number.class, 2, "NUMERIC", -127, 0, false);
    attrs[(1)] = new DomainAttributeDef("Content", "CONTENT", 1, java.lang.String.class, 12, "VARCHAR", -127, 4000, false);
    Is there anything wrong with this StructureDef?
    When running the BC-Browser with -Djbo.debugoutput=console -Djbo.jdbc.driver.verbose=true parameters I get suspect warnings when browsing the records
    [196] Executing FAULT-IN...SELECT NR, NAME FROM B_THESAURI BThesauri WHERE NR=:1
    [197] SQLException: SQLState(null) vendor code(17074)
    [198] java.sql.SQLException: Ungültiges Namensmuster: XMLTEST.null
    ...snip: detail of stack...
    [240] SQLException: SQLState(null) vendor code(17060)
    [241] java.sql.SQLException: Deskriptor konnte nicht erstellt werden: Unable to resolve type "null"
    ...snip: detail of stack...
    [280] Warning:No element type set on this array. Assuming java.lang.Object.
    (XMLTEST is the name of the schema)
    Seems as if the framework can't read the TypeDescriptor or does not know which descriptor to read (XMLTEST.null??)
    Do I have to implement my own JboTypeMap?
    Please help, I'm stuck.
    Thanks in advance, Christian

    Thanks for your suggestion, but it seems to me as if there is one level missing.
    in pl/sql I have following structure:
    Struct MULTI_LANGUAGE (Object type) - outermost
      Array LANGUAGE_TABLE (nested table type)
        Struct LANGUAGE_FIELD (Object type simple) - innermostthe reason why i had to wrap another struct around the array was because it is not possible to define methods on a nested table. this is only possible on objects.
    on the outermost object type (which holds the array of language fields) I needed to define following 2 methods for direct access:
    getContent (langId in number) returns varchar2
    setContent (langId in number, langContent in varchar2)
    I would like to rebuild the same structure in java, because newly written java code should live in perfect harmony with legacy pl/sql code ;-)
    Both applications (Java and pl/sql) have to access the same data as long as migration to java goes on.
    Is this nested structure too much for a Domain?
    Any other suggestions?
    Thanks again, Christian

  • How can i compare:  java.util.Date oracle.jbo.domain.Date?

    I have made a ViewObject wich contains a date column.
    I want to check if this date is smaller/greater than sysdate:
    i get following error:
    Error(45,24): method <(java.util.Date, oracle.jbo.domain.Date) not found in class Class4
    code:
    SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
    // set up rules for daylight savings time
    pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
    pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
    // create a GregorianCalendar with the Pacific Daylight time zone
    // and the current date and time
    Calendar calendar = new GregorianCalendar(pdt);
    Date trialTime = new Date();
    calendar.setTime(trialTime);
    (VO_ULNRow)singleRow = null;
    while(vo.hasNext()){                                             // ViewObject vo;
    singleRow = (VO_ULNRow)vo.next();
    if(calendar.getTime() < singleRow.getEO_ULN_BORROWFROM()); //singleRow returns oracle.jbo.domain.Date
    etcetera
    how can i compare those 2?

    Hi,
    oracle.jbo.domain.Date has two methods which suit your needs
    longValue() which returns a long (though I'm not sure if returns a long comparable to the long returned by java.util.Date)
    and dateValue() which returns a java.util.Date
    I hope it helps,
    Giovanni

  • Java.util.Date oracle.jbo.domain.Date how can i compare?

    I have made a ViewObject wich contains a date column.
    I want to check if this date is smaller/greater than sysdate:
    i get following error:
    Error(45,24): method <(java.util.Date, oracle.jbo.domain.Date) not found in class Class4
    code:
    SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
    // set up rules for daylight savings time
    pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
    pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
    // create a GregorianCalendar with the Pacific Daylight time zone
    // and the current date and time
    Calendar calendar = new GregorianCalendar(pdt);
    Date trialTime = new Date();
    calendar.setTime(trialTime);
    (VO_ULNRow)singleRow = null;
    while(vo.hasNext()){ // ViewObject vo;
    singleRow = (VO_ULNRow)vo.next();
    if(calendar.getTime() < singleRow.getEO_ULN_BORROWFROM()); //singleRow returns oracle.jbo.domain.Date
    etcetera
    how can i compare those 2?

    i get following error:
    Error(45,24): method <(java.util.Date,
    oracle.jbo.domain.Date) not found in class Class4
    if(calendar.getTime() <
    singleRow.getEO_ULN_BORROWFROM()); //singleRow returns
    oracle.jbo.domain.Date
    how can i compare those 2? You cannot compare these two values directly. You must convert the oracle.jbo.domain.Date object to a GregorianCalendar object. Something like:
      oracle.jbo.domain.Date dt = singleRow.getEO_ULN_BORROWFROM();
      GregorianCalendar gc = new GregorianCalendar(dt.getYear(), dt.getMonth(), dt.getDay());
      if (calendar.getTime() < gc.getTime())
      }

  • Getting Error:::oracle.jbo.domain.Date cannot be cast to java.lang.String

    Hi Friends,
    I have simple req'.
    i have one date filed in OAF page...if user has change the date filed..means if he incresed by 2 days..then i need to call one procedure..if not no need to call....
    first am picking that date field to by uusing prepared stmt and putting in to one variable..like below
    try {
    ps1 = am.getOADBTransaction().getJdbcConnection().prepareStatement("SELECT -------");
    ResultSet rs2 = ps1.executeQuery();
    while (rs2.next()) {
    schDate = rs2.getString(1);//storing the value
    } catch (Exception e) {
    throw OAException.wrapperException(e);
    Next..am picking the current value like this(user can change the value) like below...
    OAViewObject viewObj = (OAViewObject)am.findViewObject("simpleVO");
    String currSchDate = (String)viewObj.getCurrentRow().getAttribute("iDate");
    java.text.SimpleDateFormat dtFormat = new java.text.SimpleDateFormat ("MM/dd/yyyy");
    StringBuilder date = new StringBuilder(dtFormat.format(currSchDate));
    Then am comparing the values like below..
    if (schDate.equals(date)) {
    String outParamValue = "";
    String secondOutParamValue = "";
    but am geting the below error
    ## Detail 0 ##
    java.lang.ClassCastException: oracle.jbo.domain.Date cannot be cast to java.lang.String
         at xxuss.oracle.apps.abc.webui.xxPGCO15.processFormRequest(xxGCO15.java:594)
    Appriciate any help...its very urgent
    Regards
    Harry

    Instead of :
    String currSchDate = (String)viewObj.getCurrentRow().getAttribute("iDate");Try
    String currSchDate = viewObj.getCurrentRow().getAttribute("iDate").toString();
    -Anand

  • Adding one day to a oracle.jbo.domain.Date and truncating the time part

    JDev 11.1.1.4.0
    Hello
    I need to add a day to oracle.jbo.domain.Date and get back a oracle.jbo.domain.Date without the time part.
    So far I've got
    Date valueDate = (Date)rowCpt.getAttribute("ValueDate");                                       
    Calendar cal = Calendar.getInstance();
    cal.setTime(new java.util.Date(valueDate.timestampValue().getTime()));
    cal.add(Calendar.DATE, 1);
    Date newDate = new oracle.jbo.domain.Date(new Timestamp(cal.getTime().getTime()));This adds 1 day to the date but keeps the time part of the date.
    How do I get rid of the time part of the date ?
    Thanks
    Paul

    The Calendar class allows you to set or clear each field.
    Date valueDate = (Date)rowCpt.getAttribute("ValueDate");                                       
    Calendar cal = Calendar.getInstance();
    cal.setTime(new java.util.Date(valueDate.timestampValue().getTime()));
    cal.add(Calendar.DATE, 1);
    cal.clear(Calendar.HOUR);
    cal.clear(Calendar.MINUTE);
    cal.clear(Calendar.SECOND);
    cal.clear(Calendar.MILLISECOND);
    Date newDate = new oracle.jbo.domain.Date(cal.getTimeInMillis());should work.
    Timo

  • How to convert String (dd-MMM-yyyy) to oracle.jbo.domain.Date

    Hi
    Could you please tell how do I convert String of date in format dd-MM-yyyy to ADF date? Please show me some sample.
    Thanks

    http://javaalmanac.com/egs/java.text/FormatDateDef.html
    Once you have a java.util.Date you can convert it to oracle.jbo.domain.Date. (see http://www.fifkredit.com/bc4jdoc/rt/oracle/jbo/domain/Date.html)

  • Problems Validating an Attribute of type oracle.jbo.domain.date

    I have a form that has a date input field. I am trying to customise the exception error for this field for when the user enters something other than my dd/MM/yyyy format. ie JBO-25009: oracle.jbo.domain.DataCreationException
    This Attribute uses a the oracle.jbo.domain.date data type. An exception is finally thrown when the transaction trys to commit.
    My problem is that I can't customise the exception because I can't catch where it is occuring. I have tried at the <setAttributeInternal>, <setAttribute> and <validateEntity> levels uses both try{}catch(Jbo Exception){} and try{}catch(AttrValException){}. I believe the reason for this is because the problem occurs because the parse value to functions are invalid dates so it never enters them.
    If this is true validation and any exception thrown should occur at the data type level, but the the oracle.jbo.domain.date class doesn't have a validate method.
    Can someone please help me get around this problem. Or tell me if the have a solution for date input validation.

    The usecase is as follows:
    I have a DynaAction Form with a input field for a date value. This field in the form is associated with an entity attribute that is of the type oracle.jbo.domain.date
    In the message bundle for this entity I specify a format (dd/MM/yyyy) and formatter for the field (oracle.jbo.format.DefaultDateFormatter). In the jsp page I display the field using the following tag within the <jbo:row> tags,
    <jbo:InputDate dataitem="ChangeDate" formname="ApplicationReleaseForm"/>
    The date picker script works well here and the formatter formats it correctly.
    My error occurs when an invalid date value is entered. Ie characters like "abc" or numeric values that don't match a date format ie my date format (dd/MM/yyyy) or the default format of the jbo.domain.date type(yyyy-MM-dd).
    On submitting my form the input is posted to an action that extends the Update action class. I use the following expression to cache the input from the form in the viewobject:
    ActionForward actionForward = super.execute(mapping,form,request,response);
    The invalid input appears to be able to slip through this call without causing an exception, unless I make the attribute manditory. In this case an exception is thrown causing the form to be returned and the mandatory value error message to be shown.
    If the attribute is not mandatory the exception is not thrown until I make a call to commit; eg
    context.getApplicationModule().getTransaction().commit();
    The DataCreationException is the initial exception that is caught and causes the rest of the transaction to fall over.
    It is my understanding that if the input is wrong then it should be picked up when the form data is pushed into the viewobject, ie in the call to execute and at the setAttributeInternal() method call for the attribute in the viewobject. I don't believe that the input gets this far as the input is not a valid date, indicating to me that the oracle.jbo.domain.date should be the object throwing the exception.
    I hope this gives you a better understanding of the process and where and what causes the problem to occur.

  • GetCurrentDate() not found in  oracle.jbo.domain.Date;

    Is it a known bug.
    Then how do we get the current date and time?
    Thanks in advance.

    Viani - you're right, but oracle.jbo.domain.Date is definitely not right - see Calendar as suggested above.
    John

  • How do I use oracle.jbo.domain.Date truncate() method?

    Hello -
    I want to get the equivalent of "trunc(SYSDATE)" in the form of an oracle.jbo.domain.Date instance.
    I think I can do this by getting the current date and truncating the time portion:
    Date myDate = Date.getCurrentDate();
    myDate.truncate(some_precision_string);
    Issue is: what do I use for the precision string? (Javadoc for class (and its parent) is not helpful...)
    Thanks,
    -- Scott

    Nevermind. Apparently these methods don't really exist.
    (Although documentation in 9.0.3.3 JDev under Help -> Help Topics -> Contents Tab -> Reference -> Business Components Oracle Domains (this one is a javadoc page) say that they do....)

Maybe you are looking for

  • I cannot increase volume on Voice Memo

    Does anyone know how to increase volume on Voice Memo? I almost do not hear my messages (unless I shout or put my phone in front of my lips and talk loud).

  • Quick par upload NWDS ERROR   Unexpected end of file from server

    Hi: I can´t deploy my par file from NWDS, this is the error: 28.04.09 / 08:24] #ERROR LEVEL# com.sap.portal.developmentTools.ideSpecific.eclipse.wizards.sapmakepar.SAPMPWizard$1 > No Information java.net.SocketException: Unexpected end of file from s

  • How to include images/icons for a jar file

    Hi, I need to create a jar file which will contain my application. My source code (.java) files are in "app" folder. I compiled that using javac -d . *.java and one package("appl") was created. I have all icons and images related to my application ar

  • Preview not opening anything.

    I installed Autocad 2011 and aperture. But after that all the pdf and pics changed their "logo" to sketchbookexpress' one..... I also reinstalled the preview from Mac Installation DVD, but it didn't work... Plz help, I am using Adobe reader now... wh

  • Cannot open mk:@msitstore: [path name]

    I'm working in Robhelp for Word 7 and up until last week I was able to view the results of my compiled help in Robohelp. When the file is done compiling and I try to click 'View Results,' I now get 'Cannot open the file: mk:@msitstore:x\doc_4x\ap\out