OpenSQLException - object of type java.sql.Date is not normalized

Hi,
I am attempting to code an SQL query in an EJB and get the following exception:
com.sap.sql.log.OpenSQLException: The object of type java.sql.Date with the value '2010-06-04 13:21:09.424' assigned to host variable 1 is not normalized. It must not contain time components in the time zone running the virtual machine. at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85) at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124) at com.sap.sql.jdbc.common.CommonPreparedStatement.setDate(CommonPreparedStatement.java:650) at......
Below is the code snippet I am using:
                    private static String selWQ  = "Select * from ZZZZ_TABLE " +
                                                                   "where DATEFROM >= ? " +
                                                              "and DATETO <= ? ";
     public UsageRecord[] getRecords(Date fromDate,Date toDate)
          UsageRecord[] ura = null;
          String q          = null;
          ArrayList al      = new ArrayList();
          try
               q = selWQ;
               conn.open();
               PreparedStatement p = conn.prepareStatement(q);               
               p.setDate(1, fromDate);
               p.setDate(2,toDate);                    
               ResultSet rs = p.executeQuery();
I have a PreparedStatement and am using setDate to set the values. The fromDate and toDate parameters are of type java.sql.Date
Can someone please tell me what I am doing wrong and how to fix it?
thanks
Brian

As requested, here is an example of what I used to resolve this:
               PreparedStatement p = conn.prepareStatement(q);
               SimpleDateFormat ddf = new SimpleDateFormat("yyyy-MM-dd");
                                           String sFrom = ddf.format(new java.util.Date(fromDate));
               String sTo   = ddf.format(new java.util.Date(toDate));
               p.setDate(1, java.sql.Date.valueOf(sFrom));
               p.setDate(2, java.sql.Date.valueOf(sTo));
               ResultSet rs = p.executeQuery();
fromDate and toDate are parameters of type long...
regards
Brian

Similar Messages

  • Converting String foramt(yyyy-mm-dd) to java.sql.Date format(mm/dd/yyyy)

    Hi,
    I am new to this Technology.
    in my Project DataBase I have the date field as String in format yyyy-mm-dd. when I am trying to fetch this date through the front-end I need to see the date in dd/mm/yyyy format of type java.sql.Date Variable.
    if you know, Pl help me.
    Thanks in Advance,
    Kamala.

    Then use a SimpleDateFormat object to parse it into a Date object, and also to format the Date the way you want to see it, rather than simply relying on the toString() implementation.

  • Convert Calendar to Java.sql.Date

    I seached for a solution for converting a Calendar-object to a java.sql.date for inserting it into a MySQL DB (DateTime). I know this question is a FAQ. The solution I found is the following code:
    java.sql.Date sqlDate =  new java.sql.Date(cal.getTime().getTime() );When i do a print of the sqlDate to the console I get: sqlDate: 2005-06-27
    But when I look into de DB I get the following date: 27/05/1905
    I know that in Java the months are starting from 0-�11 and that the years counting is starting from 1900. But I assume that the solution is not to just add the correct month and year manually. because I get a correct console-output. If I do this I get a correct DB Date, but a wrong console-date.

    II dont know if you found an answer but I needed a similar solution so I wrote a test program.
    Let me know if this solves the problem for you.
    import java.util.*;
    import java.sql.*;
    public class dateTest{
    public static void main(String args[]){
    // Step by step
    // Calendar rightNow = Calendar.getInstance();
    // java.util.Date today = rightNow.getTime();
    // long theTime = today.getTime();
    // java.sql.Date sDate = new java.sql.Date(theTime);
    // In one line
    java.sql.Date sDate = new java.sql.Date(Calendar.getInstance().getTime().getTime());
    System.out.println("sDate is: "+sDate.toString());
    }

  • Convert java.sql.date to dd.mm.yyyy format

    Hi,
    Can any one tell me how to convert java.sql.date to dd.mm.yyyy format
    Regards,
    H.V.Swathi

    Hi ,
    Create a simple data type of type java.sql.date and give the format in it as "dd/MM/yyyy". This will work i guess.
    Regards
    Ishita

  • (Again) java.util.Date vs java.sql.Date

    Hi there,
    (Again) Im trying to understand the EXACT difference between
    java.util.Date vs java.sql.Date.
    Googling, I can see that this is a very "popular" subject, but I still
    cannot figure out it exactly.
    Many writers claim that java.sql.Date only stores the DATE part (yyyy-
    mm-dd) but not the TIME part (hh:MM:ss) of a Date/Time value, but that
    I can easily disprove:
                    java.util.Date ud = new java.util.Date();                 java.sql.Date sd = new java.sql.Date(ud.getTime());                 System.out.println(DateFormatUtils.                                 format(ud, "yyyy-MM-dd HH:mm:ss.SSS"));                 System.out.println(DateFormatUtils.                                 format(sd, "yyyy-MM-dd HH:mm:ss.SSS"));
    Output:
                    2009-09-18 15:17:36.635                 2009-09-18 15:17:36.635
    So, apparently, java.sql.Date and java.util.Date have THE SAME
    precision (at least down to the millisecs...).
    And the official API documentation, really looks more confusing than
    helpful to me::
    *"java.sql.Date:*
    *A thin wrapper around a millisecond value that allows JDBC to identify*
    *this as an SQL DATE value. A milliseconds value represents the*
    *number of milliseconds that have passed since January 1, 1970*
    *00:00:00.000 GMT.*
    *To conform with the definition of SQL DATE, the millisecond values*
    *wrapped by a java.sql.Date instance must be 'normalized' by setting*
    *the hours, minutes, seconds, and milliseconds to zero in the*
    *particular time zone with which the instance is associated. "*
    Exactly what means "an SQL DATE value" ? How EXACTLY does it differ
    from a java.util.Date value?
    Most importantly: WHY does JDBC need to distinguish between them?
    And, here again: *"a java.sql.Date instance must be 'normalized' by*
    *setting the hours, minutes, seconds, and milliseconds to zero in the*
    *particular time zone..."*
    What does that mean exactly? Apparently, the constructor doesnt
    enforce this restriction, per the example above. So what's the REAL
    point with this type, java.sql.Date?
    Very greatful, if you can help me clarify this, once and for all.
    TIA,

    And the official API documentation, really looks more confusing than helpful to me:The problem is that you need to understand SQL as well as Java for this to make sense. It's not the Java API's job to tell you how your SQL database works - there's a myriad of subtle differences even when the DB is compliant with the SQL spec.
    Most compliant databases support DATE, TIME, and TIMESTAMP values. DATE represents only a date. TIME represents only a time. TIMESTAMP represents both. There are further complicating factors, but that's roughly how it stands.
    In Java the normal type for representing time is (or was when the API was created) the java.util.Date but this is a close approximation only to the TIMESTAMP value. In order to bring the two together the java.sql.Date, java.sql.Time and java.sql.Timestamp classes were created. Making them derive from java.util.Date was probably not a good idea.
    java.util.Date suffers from a number of deficiencies. java.util.Calendar was supposed to address them but didn't really succeed. The JodaTime library is rather better, but it's all a lot more complicated than you might expect - partly because time management really is a much harder problem than it appears at first glance - there are timezones, leap years, leap seconds, the difference between astronomical and atomic time, and so on and so forth.

  • Converting String to Date (java.sql.date)

    Hi,
    Kindly let me know how I can convert a string like
    "20061102" (YYYYMMDD) to a Date type (java.sql.date) in web Dynpro.
    Requirement is to set a DateType context Attribute with
    the value contained in the String ("20061102" ).
    Awaiting your kind responses..
    Regards,
    Mahesh

    SimpleDateFormat yyyyMMdd_parser = new SimpleDateFormat(
                   "yyyyMMdd");
    java.util.Date date=yyyyMMdd_parser.parse("20061102");
    java.sql.Date slqDate=new java.sql.Date(date.getTime());

  • Java.sql.Date vs java.util.Date vs. java.util.Calendar

    All I want to do is create a java.sql.Date subclass which has the Date(String) constructor, some checks for values and a few other additional methods and that avoids deprecation warnings/errors.
    I am trying to write a wrapper for the java.sql.Date class that would allow a user to create a Date object using the methods:
    Date date1 = new Date(2003, 10, 7);ORDate date2 = new Date("2003-10-07");I am creating classes that mimic MySQL (and eventually other databases) column types in order to allow for data checking since MySQL does not force checks or throw errors as, say, Oracle can be set up to do. All the types EXCEPT the Date, Datetime, Timestamp and Time types for MySQL map nicely to and from java.sql.* objects through wrappers of one sort or another.
    Unfortunately, java.sql.Date, java.sql.Timestamp, java.sql.Time are not so friendly and very confusing.
    One of my problems is that new java.sql.Date(int,int,int); and new java.util.Date(int,int,int); are both deprecated, so if I use them, I get deprecation warnings (errors) on compile.
    Example:
    public class Date extends java.sql.Date implements RangedColumn {
      public static final String RANGE = "FROM '1000-01-01' to '8099-12-31'";
      public static final String TYPE = "DATE";
       * Minimum date allowed by <strong>MySQL</strong>. NOTE: This is a MySQL
       * limitation. Java allows dates from '0000-01-01' while MySQL only supports
       * dates from '1000-01-01'.
      public static final Date MIN_DATE = new Date(1000 + 1900,1,1);
       * Maximum date allowed by <strong>Java</strong>. NOTE: This is a Java limitation, not a MySQL
       * limitation. MySQL allows dates up to '9999-12-31' while Java only supports
       * dates to '8099-12-31'.
      public static final Date MAX_DATE = new Date(8099 + 1900,12,31);
      protected int _precision = 0;
      private java.sql.Date _date = null;
      public Date(int year, int month, int date) {
        // Deprecated, so I get deprecation warnings from the next line:
        super(year,month,date);
        if(! isWithinRange(this))
          throw new ValueOutOfRangeException((RangedColumn)this, "" + this);
      public Date(String s) {
        super(0l);
        // Start Cut-and-paste from java.sql.Date.valueOf(String s)
        int year;
        int month;
        int day;
        int firstDash;
        int secondDash;
        if (s == null) throw new java.lang.IllegalArgumentException();
        firstDash = s.indexOf('-');
        secondDash = s.indexOf('-', firstDash+1);
        if ((firstDash > 0) & (secondDash > 0) & (secondDash < s.length()-1)) {
          year = Integer.parseInt(s.substring(0, firstDash)) - 1900;
          month = Integer.parseInt(s.substring(firstDash+1, secondDash)) - 1;
          day = Integer.parseInt(s.substring(secondDash+1));
        } else {
          throw new java.lang.IllegalArgumentException();
        // End Cut-and-paste from java.sql.Date.valueOf(String s)
        // Next three lines are deprecated, causing warnings.
        this.setYear(year);
        this.setMonth(month);
        this.setDate(day);
        if(! isWithinRange(this))
          throw new ValueOutOfRangeException((RangedColumn)this, "" + this);
      public static boolean isWithinRange(Date date) {
        if(date.before(MIN_DATE))
          return false;
        if(date.after(MAX_DATE))
          return false;
        return true;
      public String getRange() { return RANGE; }
      public int getPrecision() { return _precision; }
      public String getType() { return TYPE; }
    }This works well, but it's deprecated. I don't see how I can use a java.util.Calendar object in stead without either essentially re-writing java.sql.Date almost entirely or losing the ability to be able to use java.sql.PreparedStatement.get[set]Date(int pos, java.sql.Date date);
    So at this point, I am at a loss.
    The deprecation documentation for constructor new Date(int,int,int)says "instead use the constructor Date(long date)", which I can't do unless I do a bunch of expensive String -> [Calendar/Date] -> Milliseconds conversions, and then I can't use "super()", so I'm back to re-writing the class again.
    I can't use setters like java.sql.Date.setYear(int) or java.util.setMonth(int) because they are deprecated too: "replaced by Calendar.set(Calendar.DAY_OF_MONTH, int date)". Well GREAT, I can't go from a Date object to a Calendar object, so how am I supposed to use the "Calendar.set(...)" method!?!? From where I'm sitting, this whole Date deprecation thing seems like a step backward not forward, especially in the java.sql.* realm.
    To prove my point, the non-deprecated method java.sql.Date.valueOf(String) USES the DEPRECATED constructor java.util.Date(int,int,int).
    So, how do I create a java.sql.Date subclass which has the Date(String) constructor that avoids deprecation warnings/errors?
    That's all I really want.
    HELP!

    I appreciate your help, but what I was hoping to accomplish was to have two constructors for my java.sql.Date subclass, one that took (int,int,int) and one that took ("yyyy-MM-dd"). From what I gather from your answers, you don't think it's possible. I would have to have a static instantiator method like:public static java.sql.Date createDate (int year, int month, int date) { ... } OR public static java.sql.Date createDate (String dateString) { ... }Is that correct?
    If it is, I have to go back to the drawing board since it breaks my constructor paradigm for all of my 20 or so other MySQL column objects and, well, that's not acceptable, so I might just keep my deprecations for now.
    -G

  • How to convert JAVA.SQL.DATE date in YYYY/MM/DD format into DD/MM/YYYY

    i am using informix database which accepts date value in the form of DATE format......
    the other part of my application takes date from the field in DD/MM/YYYY format...so i have to convert my java.sql.date in YYYY/MM/DD fromat into DD/MM/YYYY fromat of same type before inserting into db......
    but using parse method in SimpleDateFormat class can get the result only in java.util.date format...
    and also using format method can result only in string conversion........

    816399 wrote:
    i am using informix database which accepts date value in the form of DATE format......Huh?
    Maybe you mean Informix (fronted by JDBC) expects date values as java.sql.Date objects?
    the other part of my application takes date from the field in DD/MM/YYYY format...
    so i have to convert my java.sql.date in YYYY/MM/DD format into DD/MM/YYYY format of same type before inserting into db......I am not sure why you are talking about formats here.
    There is no formatting inherent in a java.util.Date object
    nor in a java.sql.Date object.
    but using parse method in SimpleDateFormat class can get the result only in java.util.date format...
    and also using format method can result only in string conversion........You can easily create a java.sql.Date object from a java.util.Date object.
    String s = "31/12/2010";
    java.util.Date ud = new java.text.SimpleDateFormat("dd/MM/yyyy").parse(s);
    java.sql.Date sd = new java.sql.Date(ud.getTime());
    ud = sd; // java.sql.Date extends java.util.Date so no conversion is needed

  • Poblem with java.sql.Date while inserting to a table

    Hi All,
    I have a PostgreSQL database table which contains fields(columns ) of type date. I want to insert values to the table in the[b] �dd-MMM-YYYY� format using the prepared statement.
    My code is as follows
    java.text.DateFormat dateFormatter =new java.text.SimpleDateFormat("dd-MMM-yyyy");
    String formatedDate=dateFormatter.format(theDate);
    currentDate = new java.sql.Date(dateFormatter.parse(formatedDate).getTime())
    �������������������
    �������������������
    �������������������
    pst.setDate(12,currentDate);The problem is the currentDate variable gives date only in the �YYYY-MMM-dd� format but requirement is the currentDate variable should give date in the �dd-MMM-YYYY� format and this should be save to table as java.sql.Date type
    There is any solution???? please help me...
    Thanks and Regards,
    Hyson_05

    Hi,
    What are you talking about? A Date does always wrap a millisecond value, and doesn't have any formatting. It's the database, or your program which formats the date that you see.
    In short. You should format the value when you print it, and not when you store it.
    Kaj

  • Problem Writing java.sql.Date to MS Access

    I have a relatively simple application that is for my own use (not distributed on an enterprise-wide basis). As I don't have an IT staff, I'm using a rudimentary Java front-end (v1.3.1) and a Microsoft Access backend.
    I seem to have trouble using INSERT/UPDATE statements with the MS Access Date/Time data type. Below is an example of code being used (id is defined as Text, amount is a Number and timestamp is Date/Time):
    conn = DriverManager.getConnection("jdbc:odbc:markets", "", "");
    conn.setAutoCommit(true);
    String sql = "INSERT INTO temp (id, amount, timestamp) VALUES (?, ?, ?)";
    PreparedStatement stmt = conn.prepareStatement(sql);
    String id = args[0];
    int len = id.length();
    java.sql.Date dt = new java.sql.Date(new java.util.Date().getTime());
    stmt.setString(1, id);
    stmt.setDouble(2, id.length());
    // I think the problem is here - the JDBC driver doesn't properly map dates to Access???
    stmt.setDate(3, dt);
    stmt.execute();
    stmt.close();
    conn.close();And I get the following error:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access
    Driver] Syntax error in INSERT INTO statement.
            at sun.jdbc.odbc.JdbcOdbc.createSQLException (JdbcOdbc.java:6879)
            at sun.jdbc.odbc.JdbcOdbc.standardError (JdbcOdbc.java:7036)
            at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect (JdbcOdbc.java:3065)
            at sun.jdbc.odbc.JdbcOdbcStatement.execute (JdbcOdbcStatement.java:338)
            at TestWritingDate.main(TestWritingDate.java:31) I'm virtually certain this is a translation problem with
    the java.sql.Date and the JDBC driver. But I can't seem
    to overcome this. Any help is DESPERATELY needed.
    Thanks.
    Matt

    That was it....thanks...didn't even consider that....perhaps I should start using class names that are already in use too :-). Thanks again...

  • Add one day to java.sql.date

    I ask user to enter a date: yyyy-mm-dd, then I want to add one day to that date, I don't know how to do it?
    java.sql.Date time2 = java.sql.Date.valueOf( args[0] );
    Many Thanks.

    since a date object is really nothing more than a long you can always add one day's worth of milliseconds to it....
    long milliInADay = 1000 * 60 * 60 * 24;
    Date d = ......
    d.setTime(d.getTime() + milliInADay);although there may be some issues with this i'm unaware of, but seems pretty straightforward to me.

  • How to use java.sql.Date ?

    hi there:
    I used
    ps.setDate(27, new java.sql.Date(new java.util.Date().getTime()));
    ps.executeUpdate();
    in my code to insert the current date to the 27th column of one table, this column's type is DATE, the database is ORACLE. However, I got the error like this one: ORA-01843: not a valid month.
    I think I incorrectly used the java.sql.Date API to cause this error. So anyone can tell me how to use it correctly?
    Thanks for the answers,
    Sway

    Other columns are all VARCHAR2 type;
    The oracle error message indicated that this is a
    date-related one. 27th are the only column using DATE
    So I came to draw my conclusion that the SQL might be
    wrong.Except that if, for example, the date column is actually at index 26 then Oracle might try to convert the string being passed in (at 26) as a date. But it isn't a date. So then oracle is going to throw an exception indicating that something is wrong - like that the month is invalid.

  • ADF: JBO-25009: Cannot create an object of type:java.math.Bi. Jdev 11.1.2.3

    Hi,
    I have created a tree structure on the left side of the page and a table on the right hand of the page. My requirement is that when I click on the node on the left side, the table on the right needs to be refreshed. For the time being the tree nodes on the left side is just one level. Eveytime I click on the node, I get the following error
    <RichExceptionHandler> <_logUnhandledException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase INVOKE_APPLICATION 5
    javax.el.ELException: oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:java.math.BigDecimal from type:java.lang.String with value:Restricted
    at com.sun.el.parser.AstValue.invoke(Unknown Source)
    at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1589)
    at org.apache.myfaces.trinidad.component.UIXTree.broadcast(UIXTree.java:237)
    at oracle.adf.view.rich.component.rich.data.RichTree.broadcast(RichTree.java:308)
    at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:157)
    at org.apache.myfaces.trinidad.component.UIXTree.broadcast(UIXTree.java:244)
    at oracle.adf.view.rich.component.rich.data.RichTree.broadcast(RichTree.java:308)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:130)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:112)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:130)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:106)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1137)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:361)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:java.math.BigDecimal from type:java.lang.String with value:Restricted
    at oracle.jbo.common.JboTypeMapEntries$2.convert(JboTypeMapEntries.java:135)
    at oracle.jbo.domain.TypeFactory.get(TypeFactory.java:869)
    at oracle.jbo.domain.TypeFactory.getInstance(TypeFactory.java:116)
    at oracle.jbo.server.AttributeDefImpl.convertToJava(AttributeDefImpl.java:2220)
    at oracle.jbo.server.ViewRowSetImpl.prepKeyForFind(ViewRowSetImpl.java:5377)
    at oracle.jbo.server.ViewRowSetImpl.findByKey(ViewRowSetImpl.java:5394)
    at oracle.jbo.server.ViewRowSetImpl.findByKey(ViewRowSetImpl.java:5296)
    at oracle.jbo.server.ViewRowSetImpl.findByKey(ViewRowSetImpl.java:5290)
    at oracle.jbo.server.ViewObjectImpl.findByKey(ViewObjectImpl.java:11628)
    at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.syncTargetIter(JUCtrlHierNodeBinding.java:641)
    at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.internalSetCurrentRow(JUCtrlHierNodeBinding.java:617)
    at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.syncCurrentRow(JUCtrlHierNodeBinding.java:547)
    at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.setRowAsCurrentOnTargetIterator(JUCtrlHierNodeBinding.java:561)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierNodeBinding.setRowAsCurrentOnTargetIterator(FacesCtrlHierNodeBinding.java:147)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.makeCurrent(FacesCtrlHierBinding.java:685)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    ... 58 more
    Caused by: java.lang.NumberFormatException
    at java.math.BigDecimal.<init>(BigDecimal.java:459)
    at java.math.BigDecimal.<init>(BigDecimal.java:728)
    at oracle.jbo.common.JboTypeMapEntries$2.convert(JboTypeMapEntries.java:129)
    ... 76 more
    Please can you let me know how I can resolve this issue.
    Thanks

    Hi, I have rechecked this issue. In the bug they say that Big Integer should be changed to Big Decimal to resolve the issue. I checked my application and saw that there is no Big Interger. Please can you guide me further.

  • How do I create a Dynamic java.sql.Date ArrayList or Collection?

    I Have a MySQL table with a Datetime field with many values inserted.
    I want to know which is the Best way to capture all the Inserted DB values inside a Dynamic Array.
    I get errors that state that I should use Matching data-types, and plus I don't know how to create or fill a Dynamic Date ArrayList/Collection.
    Please Help, I need this urgently...

    package pruebadedates;
    import java.sql.*;
    * @author J?s?
    public class ClaseDeDates {
        /** Creates a new instance of ClaseDeDates */
         * @param args the command line arguments
        public static void main(String[] args) {
            java.sql.Date aDate[] = null;       
            Connection con = null;
            Statement stmt = null;
            ResultSet rs = null;
            try{
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                con = DriverManager.getConnection("jdbc:mysql://localhost/pruebafechas", "root", "picardias");
                    if(!con.isClosed()){
                    stmt = con.createStatement();
                    stmt.executeQuery ("SELECT dates FROM datestable");
                    rs = stmt.getResultSet();
                        while (rs.next())
                        aDate[] = rs.getDate("dates");
            catch(Exception e)
               System.out.println(e);
            //System.out.println(aDate);     
    }Hi, There is my code and the errors that I get are:
    found : java.sql.Date
    required: java.sql.Date[]
    aDate = rs.getDate("dates");
    Actually I have No idea as How to get a Result set into an ArrayList or Collection. Please tell me how to do this Dynamically. I have like 25 records in that Database table, but they will grow, so I would really appreciate to know the code to do this. I suspect my problem is in the bolded part of my code.
    Thank you very much Sir.

  • Error IllegalArgumentException in java.sql.Date used PreparedStatement

    I'm found bug (probably). I have a table with column DATA type. Now I connect do database use JDBC in Java, and create PreparedStatement:
    PreparedStatement stmt = conn.prepareStatement("insert into \"Appuser\" (\"IDUser\", \"createAccountDate\") values (?,?)");
    Column createAccountDate is a DATA type. And now I invoke:
    stmt.setInt(1, 1);
    stmt.setInt(2, new java.sql.Date(-2508265596206959779));
    stmt.execute();
    and last line return exception:
    java.lang.IllegalArgumentException
    at sun.util.calendar.ZoneInfo.getOffset(ZoneInfo.java:368)
    at oracle.jdbc.driver.DateCommonBinder.zoneOffset(OraclePreparedStatement.java:15423)
    at oracle.jdbc.driver.DateCommonBinder.setOracleCYMD(OraclePreparedStatement.java:15561)
    at oracle.jdbc.driver.DateBinder.bind(OraclePreparedStatement.java:15641)
    at oracle.jdbc.driver.OraclePreparedStatement.setupBindBuffers(OraclePreparedStatement.java:2866)
    at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:2151)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3280)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3390)
    at // line stmt.execute();
    Another values of Data are OK. Probably value -2508265596206959779 cause that error.
    It's a bug? Better will be SQLException if it is a bug.
    My configuration:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Windows XP SP3, Java 1.6.0_20,
    ojdbc14.jar, Oracle JDBC Driver version - "10.2.0.1.0XE

    Probably value -2508265596206959779 cause that errorMaybe, whatever that .date( -ReallyLotsOfmSec ) date values is, pretty sure its outside the valid values for a date column, 4712BC to 9999AD is the min/max.
    Perhaps the java code can handle it, an oracle date type can not.

Maybe you are looking for

  • Dunning Status Report

    Report should be pulling information from dispute management.  Report should pull all active dispute cases by company code (Company Code and Name should be at the top of the report).  Report should show dispute case ID, case status, customer ID, cust

  • BW Web reporting failed

    Hi, I have a one huge BW report and it can be accessed in BEX .However, when i try to execute the same report in Web, there is error message 'An error has occured.Restart'. i have checked in ST22 and notice there is abap dump. Abap Dump : Unable to f

  • While applying the patch getting an error Failed:xdoloader.class on worker

    Hi, While applying the patch getting an error Failed:xdoloader.class on worker

  • My incoming emailes default to plain text even though view-message body as-originalHTML is checked

    Most (not all) of my incoming emails (in particular from one main client's employees) always come in plain text, I want to be able to view all message in HTML format and reply in html format (this is generally fine fr my response, but the trail leave

  • Div tag not expanding with content.. Help please!

    Hi there, Firstly I'm reasonably new to this so if I appear stoopid, it's possible that I am. I have been building a CSS based page with Div tags. What I'm trying to achieve is an html body that has a #wrapper centred on the page, then a #header, #na