Inconsistent Date Output

In my textbook the following statement was made:
Quote
The compiler will interpret an incorrect date, such as March 32 as
being April 1.
Unquote
I then attempted to verify this fact.
The code I used was:
Date toDay = new Date();
ToDay.setDate(toDay.getDate()+2);
Result = Date returned was April 2
According to the book I should have seen the date of 1 April in the
output. Thinking that the problem could be related to the Date class as
during compiling I was informed by that the Date class was depreciated,
I then converted all code to use the Calendar Class, but for some
reason that I am unable to determine when I supply a valid date I get
back a wrong date, this is before any calculations are done.
Now with the Calendar class the date 31 March - Month 03 - returns the
date 1 April.
Code:
import java.util.*;
public class DatePlay
public static void main (String[] args)
Calendar test = Calendar.getInstance();
System.out.println("Before \n");
test.set (Calendar.MONTH, 03);
test.set (Calendar.DATE, 31);
System.out.println("Current Day: " + test);
System.out.println("\n");
System.out.println("Current Day: " +test.get(Calendar.DAY_OF_MONTH));
System.out.println("Current Day: " + test.get(Calendar.DATE));
System.out.println("Current Month: " +  test.get(Calendar.MONTH));
System.out.println("Current Year: " + test.get(Calendar.YEAR));
}Output:
Before
Current Day: java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllFieldsSet=true,lenient=true,zone=sun.ut
il.calendar.ZoneInfo[id="Africa/Harare",offset=7200000,dstSavings=0,useDaylight=false,transi
tions=3,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,Y
EAR=2003,MONTH=3,WEEK_OF_YEAR=17,WEEK_OF_MONTH=4,DAY_OF_MONTH=31,DAY_OF_
YEAR=115,DAY_OF_WEEK=6,DAY_OF_WEEK_IN_MONTH=4,AM_PM=1,HOUR=4,HOUR_OF_DAY
=16,MINUTE=46,SECOND=49,MILLISECOND=321,ZONE_OFFSET=7200000,DST_OFFSET=0
Current Day: 1
Current Day: 1
Current Month: 4
Current Year: 2003
Any assistance to resolve this situation will be greatly appreciated

Month numbers start at 0, not 1, so the Calendar thinks you're trying to specify the 31st of April, and is converting it to the 1st of May.
Sylvia.

Similar Messages

  • Report is executing in background and need data(output) in excel format

    Report is executing in background and need data(output) to get downloaded in excel format in my PC from an internal table;;in any drive i.e. C: or D: .When executing in backround it prompt to user with which location excel file to be saved and the name of file.How to download in background in excel format?
    Edited by: PRASHANT BHATNAGAR on Aug 26, 2008 6:24 AM

    Hi
    Download a report to excel with format (border, color cell, etc)
    Try this program...it may help you to change the font ..etc.
    Code:
    REPORT ZSIRI NO STANDARD PAGE HEADING.
    this report demonstrates how to send some ABAP data to an
    EXCEL sheet using OLE automation.
    INCLUDE OLE2INCL.
    handles for OLE objects
    DATA: H_EXCEL TYPE OLE2_OBJECT,        " Excel object
          H_MAPL TYPE OLE2_OBJECT,         " list of workbooks
          H_MAP TYPE OLE2_OBJECT,          " workbook
          H_ZL TYPE OLE2_OBJECT,           " cell
          H_F TYPE OLE2_OBJECT.            " font
    TABLES: SPFLI.
    DATA  H TYPE I.
    table of flights
    DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
    *&   Event START-OF-SELECTION
    START-OF-SELECTION.
    read flights
      SELECT * FROM SPFLI INTO TABLE IT_SPFLI UP TO 10 ROWS.
    display header
      ULINE (61).
      WRITE: /     SY-VLINE NO-GAP,
              (3)  'Flg'(001) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (4)  'Nr'(002) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (20) 'Von'(003) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (20) 'Nach'(004) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (8)  'Zeit'(005) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP.
      ULINE /(61).
    display flights
      LOOP AT IT_SPFLI.
      WRITE: / SY-VLINE NO-GAP,
               IT_SPFLI-CARRID COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
      ENDLOOP.
      ULINE /(61).
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-007
           EXCEPTIONS
                OTHERS     = 1.
    start Excel
      CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
    PERFORM ERR_HDL.
      SET PROPERTY OF H_EXCEL  'Visible' = 1.
    CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:\kis_excel.xls'
    PERFORM ERR_HDL.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-008
           EXCEPTIONS
                OTHERS     = 1.
    get list of workbooks, initially empty
      CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
      PERFORM ERR_HDL.
    add a new workbook
      CALL METHOD OF H_MAPL 'Add' = H_MAP.
      PERFORM ERR_HDL.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-009
           EXCEPTIONS
                OTHERS     = 1.
    output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
      PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
      PERFORM FILL_CELL USING 1 3 1 'Von'(003).
      PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
      PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
      LOOP AT IT_SPFLI.
    copy flights to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
        PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
        PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
        PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
        PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
      ENDLOOP.
    changes by Kishore  - start
    CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
      CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTING #1 = 2.
      PERFORM ERR_HDL.
    add a new workbook
      CALL METHOD OF H_MAPL 'Add' = H_MAP  EXPORTING #1 = 2.
      PERFORM ERR_HDL.
    tell user what is going on
      SET PROPERTY OF H_MAP 'NAME' = 'COPY'.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-009
           EXCEPTIONS
                OTHERS     = 1.
    output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
      PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
      PERFORM FILL_CELL USING 1 3 1 'Von'(003).
      PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
      PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
      LOOP AT IT_SPFLI.
    copy flights to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
        PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
        PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
        PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
        PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
      ENDLOOP.
    changes by Kishore  - end
    disconnect from Excel
         CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING  #1 = 'C:\SKV.XLS'.
      FREE OBJECT H_EXCEL.
      PERFORM ERR_HDL.
          FORM FILL_CELL                                                *
          sets cell at coordinates i,j to value val boldtype bold       *
    FORM FILL_CELL USING I J BOLD VAL.
      CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_ZL 'Value' = VAL .
      PERFORM ERR_HDL.
      GET PROPERTY OF H_ZL 'Font' = H_F.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_F 'Bold' = BOLD .
      PERFORM ERR_HDL.
    ENDFORM.
    *&      Form  ERR_HDL
          outputs OLE error if any                                       *
    -->  p1        text
    <--  p2        text
    FORM ERR_HDL.
    IF SY-SUBRC <> 0.
      WRITE: / 'Fehler bei OLE-Automation:'(010), SY-SUBRC.
      STOP.
    ENDIF.
    ENDFORM.                    " ERR_HDL
    Regards
    Murali Papana

  • While trying to open the order in co03 or co02, It is not opening and showing the error message as "Inconsistent data : order 107434 16.09.2013, duplicate entry o 0020. is showing ?

    Hi,
    While trying to open the order in co03, co02, I am getting the below error message : Inconsistent data : order 107434 16.09.2013, duplicate entry o 0020 is showing. Please guide me the way forward.
    Regards,
    Mastan.

    Hi Mastan
    The report mentioned by Rajen should clear the inconsistent records.
    Please observe that you could have found this by yourself report with a quick note search for this error message or even searching for old threads.
    Even a google search points to the solution.
    You should do your own research before opening such kind of thread.
    BR
    Caetano

  • How to pull data output of TCODE "MRKO" into a BI Cube.....??

    Hi Gurus:
    One of the business requirement is to EXTRACT data from relevant tables that the R/3 TCode "MRKO" provides in a report format in to BI. I don't tknow if there is any std. SAP extractor that would provide me the details. We need this data to determine the payment DATE based on "Payment Terms" using a logic, then summarize the data at each Vendor level and pass this information to the BI Cube. We need this information for a Cash Flow Forecasting project.
    I am not familiar with the Tcode MRKO or the program. I would appreciate it if anyone can shed some light here. I basically need a Total Due amount for a month period, Vendor, The date on which the payment has to be made in future based on the Payment terms and Company code. I don't know the tables involved, but the TCODE provides a "Total" per Vendor and thats what I would like to capture and pass to BI. How can I achieve this?
    Appreciate the name of the STD extractor if one exists or the table(s), and if any logic is necessary.....?
    Thanks a lot in advance.....!
    PBSW

    HI,
    I am not aware of any standard extractor for the report that you get from Tcode MRKO, But I can suggest you in a very customized way to extract the data into BW.
    When you run the transaction "MRKO", please check the program that is running in the background for that report to run and get the data output. You could easily find from the lower side menu bar.
    Once if you get to know the program, create a structure and create a datasource assigned to that structure, where  the datasource uses funcion module as its extraction method. In SAP you can easily convert a program into a function module and let the extractor fill your datasource for extraction.
    - Another way of doing it, is to find out the tables that it is retrieving from the report MRKO and create a structure with those fields filled up using a function module. And then use that structure and function module for your new datasource to extract.

  • How to show data output in SSRS

    Below is my simply query.  I need to use Matrix SSRS format. I will put "Region" in "row" column, Header will use "Customer_Requested_Date" field, and will use "Amount" in the data session.
    The data output in the "Header" field will show January.....until December (current month is December).  In the Amount field under "December" (current month), I need to compute the formula like "Customer_Request_Month"
    < =  Current Month".  (I do not have the field name called Current Month, need to get a Date/Time function to display Current Month).
    How I can come up the data output under December Header field to show the current Amount in that section?
    November, 2014
    December,2014
    Region
    Amount
    CRD Month < = Current Month
    Select
    Customer_Request _Date,
    Customer_request_Month,
    Transaction_Type,
    Region,
    Amount
     From Table
    Thanks,
    Josephine
    Josey Tang

    Hi Josey,
    According to your descritption, you want to show the current month in your tablix. Right?
    In Reporting Services, we can use the Now() and datepart() function to get the current month. Please use the expression below:
    =Datepart("m",Now())
    In this scenario, since you want to show the amount of current month within the column group, you need to create another dataset which always show the data of current month. Then you can use lookup() function to get the amount value from the current dataset
    based on the Region. Please follow the steps below:
    Create a same dataset(DataSet2) using your query. Add a filter on this dataset. Make Fields!Customer_request_Month.Value
    =
    Datepart("m",Now())
    Then add a column inside of column group, using the expression below:
    =lookup(Fields!Region.Value,Fields!Region.Value,Fields!Amount.Value,"DataSet2")
    The design and result look like below:
    Reference:
    Expression Examples (Report Builder and SSRS)
    Lookup Function (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Won't sync calender with mobileme "inconsistent data error message"

    I have tried about everything that I can think of but can't seem to solve this problem.
    I have a new Macbook Pro and have been using mobileme and ical for some time now. I can't get my Macbook Pro to sync with mobileme ical. It does sync with the address book, but when it gets to the ical portion it tries and then reports "can't sync due to inconsistent data on this computer. Correct data and resync calender".
    I have no idea what the "inconsistent data" is. My computer gets its time from apple.com and the time/date is correct. What is the inconsistent data. My calender and schedule is a critical issue. Please help.

    Errors in syncing can happen for all sorts of reasons - loss of network connectivity, for instance - and it might be necessary to reset the synced data from a reliable source. It's not talking about deleting anything - unless you have data on your new computer that you need to retain.
    The document says that if you have this problem on your new machine, you probably need to overwrite that local data with data from MobileMe.
    Personally, I've never lost any data with dotmac or MobileMe, so my experience is it can be relied on. I do, however, keep backups of all my data as well.

  • Inconsistent date formats between Rich Client and HTML client

    Hey All,
    Just wondering if anyone has come across an issue with inconsistent date formats from a universe based on an MS SSAS 2012 database connection in 4.x?
    The value of the date is returned as a string from the query but the object data type has been changed to a Date object meaning BusinessObjects should convert the string into a date if the format is correct.
    The problem in this is that the date being returned in Rich Client is in dd/MM/yyyy format whereas on the Web Client is in MM/dd/yyyy.
    From the Web Client business objects will return a date, however, it is a mix of MDY and DMY format.
    i.e. 15th of March will be displayed as 15/03/2014
    whereas 12th of March will be displayed as 03/12/2014
    All our application servers are configured for English (Australian) regional settings meaning all dates should be in DMY format.
    The date in the database is stored as a non-ambiguous yyyy-mm-dd format so it appears the variation is occurring somewhere between the database and BusinessObjects for the Web Client based reports only.
    I have also checked the sqlsrv.prm file based format and changed this to DMY but this has also not made a difference.
    The same universe in 3.1 and MS SSAS 2008 works correctly but not this one.

    Hi
    The date in the database is stored as yyyy-mm-dd format.
    As per user request.... Set the date format @ the Business layer level. so it will refelct same as in the WebI.
    Please find the below link. how to use custom Display option.
    BI4.1 Business Layer Enhancements - Create Display Format

  • Problems with java constructor: "inconsistent data types" in SQL query

    Hi,
    I tried to define a type "point3d" with some member functions, implemented in java, in my database. Therefor I implemented a class Point3dj.java as you can see it below and loaded it with "loadjava -user ... -resolve -verbose Point3dj.java" into the database.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    package spatial.objects;
    import java.sql.*;
    public class Point3dj implements java.sql.SQLData {
    public double x;
    public double y;
    public double z;
    public void readSQL(SQLInput in, String type)
    throws SQLException {
    x = in.readDouble();
    y = in.readDouble();
    z = in.readDouble();
    public void writeSQL(SQLOutput out)
    throws SQLException {
    out.writeDouble(x);
    out.writeDouble(y);
    out.writeDouble(z);
    public String getSQLTypeName() throws SQLException {
    return "Point3dj";
    public Point3dj(double x, double y, double z)
    this.x = x;
    this.y = y;
    this.z = z;
    public static Point3dj create(double x, double y, double z)
    return new Point3dj(x,y,z);
    public double getNumber()
         return Math.sqrt(this.x*this.x + this.y*this.y + this.z*this.z);
    public static double getStaticNumber(double px, double py, double pz)
         return Math.sqrt(px*px+py*py+pz*pz);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Additionally, I created the corresponding type in SQL by
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    CREATE OR REPLACE TYPE point3dj AS OBJECT EXTERNAL NAME
    'spatial.objects.Point3dj' LANGUAGE JAVA USING SQLDATA (
    x FLOAT EXTERNAL NAME 'x',
    y FLOAT EXTERNAL NAME 'y',
    z FLOAT EXTERNAL NAME 'z',
    MEMBER FUNCTION getNumber RETURN FLOAT
    EXTERNAL NAME 'getNumber() return double',
    STATIC FUNCTION getStaticNumber(xp FLOAT, yp FLOAT, zp FLOAT) RETURN FLOAT
    EXTERNAL NAME 'getStaticNumber(double, double, double) return double')
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    After that I tried some SQL commands:
    create table pointsj of point3dj;
    insert into pointsj values (point3dj(2,1,1));
    SELECT x, a.getnumber() FROM pointsj a;Now, the problem:
    Everything works fine, if I delete the constructor
    public Point3dj(double x, double y, double z)
    this.x = x;
    this.y = y;
    this.z = z;
    in the java class, or if I replace it with a constructor that has no input arguments.
    But with this few code lines in the java file, I get an error when executing the SQL command
    SELECT x, a.getnumber() FROM pointsj a;The Error is:
    "ORA-00932: inconsistent data types: an IN argument at position 1 that is an instance of an Oracle type convertible to an instance of a user defined Java class expected, an Oracle type that could not be converted to a java class received"
    I think, there are some problems with the input argument of the constructor, but why? I don't need the constructor in SQL, but it is used by a routine of another java class, so I can't just delete it.
    Can anybody help me? I would be very glad about that since I already tried a lot and also search in forums and so on, but wasn't successful up to new.
    Thanks!

    Dear Avi,
    This makes sense when it is a short code sample (and i think i've done that across various posts), but sometime this is too long to copy/paste, in these cases, i refer to the freely available code samples, as i did above on this forum; here is the quote.
    Look at examples of VARRAY and Nested TABLES of scalar types in the code samples of my book (chapter 8) http://books.elsevier.com/us//digitalpress/us/subindex.asp?maintarget=companions/defaultindividual.asp&isbn=9781555583293&country=United+States&srccode=&ref=&subcode=&head=&pdf=&basiccode=&txtSearch=&SearchField=&operator=&order=&community=digitalpress
    As you can see, i was not even asking people to buy the book, just telling them where to grab the code samples.
    I appreciate your input on this and as always, your contribution to the forum, Kuassi

  • ICal wont sync due to inconsistent data

    I get an error message saying... Calendars could not be synced due to inconsistent date. Confirm that your computers data is valid *+(not sure how to do this)+* then reset Calendars on .Mac in system preferences. *+( I have done this and had no luck)+*
    I have also gone into isync and reset my sysc history and then re-synced... having all my computer data be replaced by the .Mac data. i get the same error.
    I have 3 machines that should all be synced. I have just done a clean install on all machines in the following order:
    a mac mini, a Powermac G5, and my Macbook. The macbook is the problem machine. the other 2 systems are synced perfectly.
    Any advice?

    Dude,
    Thanks!!!
    I did two clean installations on my 2 MBPs to leopard starting Friday night and Finishing tonight. I opted to not migrate data because I wanted to leave all my messy Tiger stuff and start again.
    My first MPB must be the dominant one on .Mac because
    MBP-2 >> .Mac >> MPB-1 didn't work .. if it weren't for your reply I wouldn't have tried the other way around and would have just given up until next weekend.
    Thanks.

  • XML data output in a custom grid table

    Hi!
    I was wondering if it is possible to display xml data output in a custom-made grid table? Important is the ability to
    arrange the fields on the grid layout (not a fixed layout with columns and rows).
    I am using the latest JDeveloper release.
    Thanks!

    See [url http://docs.oracle.com/cd/E14072_01/server.112/e10592/functions251.htm#CIHGGHFB]XMLTABLE
    For example:
    -- INSERT INTO <your table name>
    WITH x AS
    (SELECT XMLTYPE('<?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <EMPNO>7782</EMPNO>
    <ENAME>CLARK</ENAME>
    <JOB>MANAGER</JOB>
    <MGR>7839</MGR>
    <HIREDATE>09-JUN-81</HIREDATE>
    <SAL>2450</SAL>
    <DEPTNO>10</DEPTNO>
    </ROW>
    <ROW>
    <EMPNO>7839</EMPNO>
    <ENAME>KING</ENAME>
    <JOB>PRESIDENT</JOB>
    <HIREDATE>17-NOV-81</HIREDATE>
    <SAL>5000</SAL>
    <DEPTNO>10</DEPTNO>
    </ROW>
    <ROW>
    <EMPNO>7934</EMPNO>
    <ENAME>MILLER</ENAME>
    <JOB>CLERK</JOB>
    <MGR>7782</MGR>
    <HIREDATE>23-JAN-82</HIREDATE>
    <SAL>1300</SAL>
    <DEPTNO>10</DEPTNO>
    </ROW>
    </ROWSET>') myxml
    FROM DUAL)
    SELECT *
    FROM   x
    ,      XMLTABLE('/ROWSET/ROW'
             PASSING x.myxml
             COLUMNS empno, ename, job, mgr, hiredate, sal, deptno);

  • How do I create individual xml files from the parsed data output of a xml file?

    I have written a program (DOM Parser) that parses data from a XMl File. I would like to create an individual file with the corresponding name for each set of data parsed from the xml document. If the parsed output is Single, Double, Triple, I would like to create an individual xml file (Single.xml, Double.xml, Triple.xml)with those corresponding names. How do I create the xml files and give each file the name of my parsed data output? Thanks in advance for your help.
    import java.io.IOException;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.SAXException;
    public class MyDomParser {
      public static void main(String[] args) {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      try {
      DocumentBuilder builder = factory.newDocumentBuilder();
      Document doc = builder.parse("ENtemplate.xml");
      doc.normalize();
      NodeList rootNodes = doc.getElementsByTagName("templates");
      Node rootNode = rootNodes.item(0);
      Element rootElement = (Element) rootNode;
      NodeList templateList = rootElement.getElementsByTagName("template");
      for(int i=0; i < templateList.getLength(); i++) {
      Node theTemplate = templateList.item(i);
      Element templateElement = (Element) theTemplate;
      System.out.println("Template" + ": " +templateElement.getAttribute("name")+ ".xml");
      } catch (ParserConfigurationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (SAXException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();

    Ive posted the new code but now I'm getting a FileAlreadyExistException error. How do I handle this exception error correctly in my code?
    import java.io.IOException;
    import java.nio.file.FileAlreadyExistsException;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.SAXException;
    public class MyDomParser {
      public static void main(String[] args) {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      try {
      DocumentBuilder builder = factory.newDocumentBuilder();
      Document doc = builder.parse("ENtemplate.xml");
      doc.normalize();
      NodeList rootNodes = doc.getElementsByTagName("templates");
      Node rootNode = rootNodes.item(0);
      Element rootElement = (Element) rootNode;
      NodeList templateList = rootElement.getElementsByTagName("template");
      for(int i=0; i < templateList.getLength(); i++) {
      Node theTemplate = templateList.item(i);
      Element templateElement = (Element) theTemplate;
      System.out.println(templateElement.getAttribute("name")+ ".xml");
      for(int i=0; i < templateList.getLength(); i++) {
      Node theTemplate = templateList.item(i);
      Element templateElement = (Element) theTemplate;
      String fileName = templateElement.getAttribute("name") + ".xml";
      Files.createFile(Paths.get(fileName));
      System.out.println("File" + ":" + fileName + ".xml created");
      } catch (ParserConfigurationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (SAXException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();

  • ORA-00932: inconsistent data types: expected NUMBER got BINARY

    ORA-00932: inconsistent data types: expected NUMBER got BINARY
    Hi,
    Could anyone help in resolving my problem?
    I ‘m developing cmp beans in Jbuilder X,
    My database is Oracle 10g, running on Linux and Application server is Oracle10gAs. Running on Windows.
    I can deploy my Entity EJB’s OK and look then up using finder methods as long as I’ve created the data directly in the database using SQL*Plus for instance.
    In the database I have my primary keys defined as type NUMBER
    In my EJB the corresponding number fields get mapped as java.math.BigDecimal.
    which according to the Oracle JDBC specification is how they are mapped.
    Problem:
    When I try to create a new database entity through my EJB entity bean I get:-
    Error "ORA-00932: inconsistent datatypes: expected NUMBER got BINARY".
    The value of the number being used as the primary key in this example is 10.
    Eg:-
    BigDecimal pk = new BigDecimal(10);
    TestBean test = home.create(pk);
    The datatype in my EJB Deployment descriptor ejb-jar-xml <pri-key-class> is java.math.BigDecimal>
    The jdbc driver defined in my application.xml is
    oracle.jdbc.driver.OracleDriverand url="jdbc:oracle:thin..." in the connection.
    I’ve even tried mapping a datatype as described in the Oracle FAQ’s but this didn’t work.
    21.     I'm trying to deploy a CMP entity bean with a field type BigDecimal and the table creation fails with an error. How do I work around this?
    You have to perform the following steps prior to deploy your application.
    o     Define the mapping for java.math.BigDecimal in the database-schemas/oracle.xml as follows:
    <type-mapping type="java.math.BigDecimal" name="number(20,8)" />o     Use this schema in your data-source as follows:-
    <data-source
    class="com.evermind.sql.DriverManagerDataSource"
    name="OracleDS"
    ejb-location="jdbc/OracleDS"
    schema="database-schemas/oracle.xml"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="scott"
    password="tiger"
    url="jdbc:oracle:thin:@localhost:1521:DEBU"
    clean-available-connections-threshold="30"
    rac-enabled="false"
    inactivity-timeout="30"
    />

    Further clarification of my problem.
    Originally I said the error occurred when deploying EJB's
    Correction: I can deploy them OK on the application server However the Error message occurs when I try to create a new EJB entity, the only value required is the Primary key which I pass as type BidDecimal.
    If I create entries directly in the database my EJB findByPrimaryKey can find entities OK.
    But I cant create new ones through EJB.
    What realy baffels me is why I'm able to read data through the connection but not write.
    The datatype in my EJB Deployment descriptor ejb-jar-xml <pri-key-class> is java.math.BigDecimal>
    The jdbc driver defined in my application.xml is
    oracle.jdbc.driver.OracleDriver
    and url="jdbc:oracle:thin..." in the connection.

  • Problems with BCS Queries Inconsistent Data

    Hi BI Experts,
    We recently had our BCS upgrade from 4.0 to 6.0 and BW upgrade from 3.5 to 7.0
    We have created some consolidated queries and we didnt change them to 7.0 they are still in 3.5 version. The problem is that we are getting some inconsistent data every time we ran those queries.
    The BWP is yet to under go upgrade process so we checked  the data in BWP (3.5) production and BWD (7.0) this tells us that the data in the tables are right.
    I ran the query in RSRT and gives inconsistent data.
    We are on the support pack 10 for BCS and
    support pack 14 for BI 7.0.

    Sorry guys....
    I want to correct one statement up there ...when I run my queries with through RSRT i dont get any inconsistent data ..the data comes exactly the way we want ...the problem is only through the BEx.
    Is it a upgrade bug or the support pack issue ..???
    Your suggestions will be appreciated with lots of points
    Thanks

  • Inconsistent Data, can't resolve issue

    Hello,
    I recently found it necessary to rebuild my Aperture Library, and shortly after I located several hundred grey squares with small red boxes on them (these were photos I had previously delted). I selected all of them and used the command-delete key command. It started to delete photos but was taking a long time so I force quit the application.
    Now everytime I lauch Aperture I get the launch window, then the beach ball of death for a min or two, and finally a dialogue that says I have inconsistent data that that Aperture must quit to rebuild. The only problem is it doesn't rebuild.
    I looked at some post with similar problems and have tried removing the Library.apdb file as well as the com.apple.Aperture.plist file. Neither of these methods solves the problem.
    Any other solutions, or am I going to need to reinstall Aperture?
    Kind Regards,
    —Eric
    Ash Films
    <edited by host>

    Turns out there were multiple types of the Library.apdb file that needed to be deleted. My Library is back up and running now.

  • Inconsistent Data Record

    One of my team members hit an error i.e Inconsistent data record
    We have already developed our model, and deployed in a Feb dataset, now when we come to an updated refreshed dataset i.e March, we hit an error where the data records are not consistent and hence the model cannot score.
    i am assuming that there may be a new attribute in the dataset which previously did not occur and hence is now not catered for in the model.
    Is this diagnosis the case. in such an instance how does ODM deal with it and what are our options as an implementation issue
    Server task state: error
    Server task detail:
    ORA-40101: Data Mining System Error ORA-40101: Data Mining System Error ORA-40109: inconsistent logical data record
    ORA-06512: at "DMSYS.DBMS_DATA_MINING", line 312
    ORA-06512: at "DMSYS.DBMS_JDM_INTERNAL", line 157
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
    ORA-06512: at "DMSYS.DBMS_JDM_INTERNAL", line 179
    ORA-06512: at line 1
    --

    This is usually caused by a duplicate attribute for a single case/row.
    This can happen if the same case id is repeated during a build operation, or if you are working with nested data, the same nested attribute name repeats for a given case.
    The first thing to do is to verify that the caseid is unique.
    Ari

Maybe you are looking for

  • Error While Running KE5T

    Short text     Error in module RSQL of the database interface. What happened?     Error in the ABAP Application Program     The current ABAP program "GP$GLX$GLPCT" had to be terminated because it has     come across a statement that unfortunately can

  • Macbook Pro Hard Drives Failing

    Hi all, I've been having massing problems with my Macbook Pro 15" 2.53 Ghz laptop. I got one brand new with apple care in December of 2008. The hard drive was the standard 320 Gb @ 5400 RPM. Within approximately two weeks of operation the computer fa

  • Rapidmarts to EBS

    Is it possible to go into EBS application using the SAP Rapidmarts implementation, like the concept of OBIEE action link, is this concept possible in SAP RapidMarts.

  • HT201269 I made an update to my iPad and after the update it went to recovery mode. It wiped all of my apps off and now I can't add apps

    I made an update to my iPad and after the update it went to recovery mode. It wiped all of my apps off and now I can't add apps

  • Saving clips in DV format

    I have been looking at this site for a few years now but this is my first post. It has been a great knowledge base and very useful and to date I have been able to get all of my answers from previous posts. This one I could not find and may just be me