How can I hold data stored in an object?

Hi everyone!
I have a problem with a Java-Program that I am trying to write for university.
The program is the following:
import java.io.*;
public class Ergasia4
{     public static void main (String args[])throws IOException
     {     int i,epilogi;
          boolean first1=true, first2=true, first3=true, first4=true;
          Ptisi A3510,A3511,A3512,A3513;
          A3510 = new Ptisi();
          A3511 = new Ptisi();
          A3512 = new Ptisi();
          A3513 = new Ptisi();
          i=0;
          for(;;)
          {     do     
               {     if (i==1) System.out.println ("Lathos epilogi");
                    System.out.println ("EPILOGI PTISIS");
                    System.out.println ("1. Ptisi A3510, ATH-SKG");
                    System.out.println ("2. Ptisi A3511, SKG-ATH");
                    System.out.println ("3. Ptisi A3512, ATH-SKG");
                    System.out.println ("4. Ptisi A3513, SKG-ATH");
                    System.out.println ("0. Exodos");
                    System.out.print ("Epilogi: ");
                    epilogi=my.readInt();
                    System.out.println ();
                    i=1;
               while ((epilogi!=0)&&(epilogi!=1)&&(epilogi!=2)&&(epilogi!=3)&&(epilogi!=4));
               if (epilogi==0) break;
               else
               {     switch (epilogi)
                    {     case 1: System.out.println("Ptisi A3510, ATH-SKG"); A3510.menu(first1); break;
                         case 2: System.out.println("Ptisi A3511, SKG-ATH"); A3511.menu(first2); break;
                         case 3: System.out.println("Ptisi A3512, ATH-SKG"); A3512.menu(first3); break;
                         case 4: System.out.println("Ptisi A3513, SKG-ATH"); A3513.menu(first4); break;
                         default : break;
class Ptisi
{     int epilogi,i;
     private boolean availiability[];
     private long telephones[];
     public void menu (boolean a) throws IOException     
     {     if (a==true) arxikopoiisi(availiability);
          a=false;
          for (;;)
          {     do
               {     if (i==1) System.out.println ("Lathos epilogi");
                    System.out.println ("1. Kratisi thesewn");
                    System.out.println ("2. Akyrwsi kratisis");
                    System.out.println ("3. Emfanisi sygentrwtikwn stoixeiwn");
                    System.out.println ("0. Exodos");
                    System.out.print ("Epilogi: ");
                    epilogi=my.readInt();
                    System.out.println ();
                    i=1;
               while ((epilogi!=0)&&(epilogi!=1)&&(epilogi!=2)&&(epilogi!=3));
               if (epilogi==1)
               {     kratisi(availiability,telephones);
                    i=0;
               else if (epilogi==2)
               {     akyrwsi(availiability,telephones);
                    i=0;
               else if (epilogi==3)
               {     emfanisi(availiability);
                    i=0;
               else if (epilogi==0) break;
     public static void kratisi (boolean availiability[],long telephones[]) throws IOException
     {     int theseis;
          long tilefwno;
          int j,i=0,x=-1;
          boolean k=false;
          i=0;
          do
          {     if (i==1) System.out.println ("Arithmos ektos oriwn");
               System.out.println ("Poses theseis theleis na kratiseis ?");
               System.out.print ("Theseis: ");     
               theseis=my.readInt ();
               System.out.println ();
               i=1;
          while ((theseis<0)||(theseis>36));
          for (i=0;i<availiability.length;i++)
          {     if (availiability==true)
               {     for (j=i;j<=(i+theseis);j++)
                    {     if (availiability[j]==false)
                         {     break;
                         else if (j==(i+theseis))
                         {     x=i;
                              break;
               if (x>-1) break;
          if (x>-1);
          {     i=0;
               do
               {     if (i==1) System.out.println ("Lathos arithmos tilefwnou");
                    System.out.println ("Eisagete ton arithmo tilefwnou");
                    System.out.print ("Arithmos: ");     
                    tilefwno=my.readInt ();
                    System.out.println ();
                    i=1;
               while (tilefwno<0);
          if (x>-1)
          {     for (i=x;i<(x+theseis);i++)
               {     availiability[i]=false; telephones[i]=tilefwno;
               System.out.println("I kratisi "+theseis+" thesewn egine epityxws");
               System.out.println();
          else System.out.println("Den yparxoun "+theseis+" diathesimes synexomenes theseis");
     public static void akyrwsi (boolean availiability[],long telephones[]) throws IOException
     {     int i,thesi,plithos,x=-1;
          i=0;
          do
          {     if (i==1) System.out.println ("Arithmos ektos oriwn");
               System.out.println ("Dwse tin prwti thesi tis akyrwsis");
               System.out.print ("Prwti thesi: ");     
               thesi=my.readInt ();
               i=1;
          while ((thesi<0)||(thesi>36));
          i=0;
          do
          {     if (i==1) System.out.println ("Arithmos ektos oriwn");
               System.out.println ("Poses theseis theleis na akyrwseis ?");
               System.out.print ("Prwti thesi: "+thesi+" Theseis: ");     
               plithos=my.readInt ();
               System.out.println ();
               i=1;
          while ((plithos<0)||(plithos>36-thesi));
          for (i=thesi;i<=(thesi+plithos-1);i++)
          {     if (availiability[i]==true)
               {     break;
               else if (i==(thesi+plithos-1))
               {     x=i;
                    break;
          if (x>-1)
          {     for (i=thesi;i<(thesi+plithos);i++)
               {     availiability[i]=true; telephones[i]=0;
               System.out.println ("I akyrwsi egine epityxws");
               System.out.println ();
          else
          {     System.out.println ("I epilegmenes theseis einai kenes");
     public static void emfanisi (boolean availiability []) throws IOException
     {     char seatmap[][]=new char [10][10];
          int k,i,j,plirotita=0;
          for (i=0;i<availiability.length;i++)
          {     if (availiability[i]==false) plirotita++;
          plirotita=plirotita*100/36;
          System.out.println("Plirotita :"+plirotita+"%");
          i=0;               
          for (j=0;j<4;j++)
          {     for (k=0;k<9;k++)
               {     if (availiability[i]==false) seatmap[j][k]='X';
                    else seatmap[j][k]='_';
                    i++;
          for (j=0;j<4;j++)
          {     for (k=0;k<9;k++)
               {     System.out.print (seatmap[j][k]+" ");
                    if ((k+1)%4==0) System.out.println();
     public void arxikopoiisi (boolean availiability[])
     {     int i;
          for (i=0;i<availiability.length;i++)
          {     availiability[i]=true;
So, this program is supposed to simulate an airline's reservations system.
There are four flights, numbered 510-513, each with an aircraft of 36 seats (9 rows of 4 seats each).
On class "Ptisi" there are 5 classes, which do the following:
a. class "menu" shows a menu, where the user can select if he wants to make a reservation, a cancellation or if he wants to view the seat map.
b. class "kratisi" performs a reservation.
c. class "akyrwsi" performs a cancellation.
d. class "emfanisi" shows the seat map.
e. class "arxikopoiisi" initializes the array "availability[36], making it all "true".
Class "Ergasia4" is supposed to create four objects, A3510-A3513, for each of the 4 flights. Then there is a menu for the user to select between the four flights. Depending on the choice of the user, the program must show the menu for one of the four available flights, as programmed on class "Ptisi" and then perform the action(s) requested by the user. On both menus, "0" exits.
So, what is my problem?
Well, when I run the program, if I select a flight, then all actions are performed without a problem, I can make a reservation, cancel some seats or view the seat map. The problem comes when I exit a flight, then work on another flight and then return on the original one. All seat reservations are gone!
Can anybody help me solve this problem?
Thank you in advance,
philimonas
P.S. If you think it would be helpful, I can omit the code of the functions that work!

Thanks for your help, doremifasollatido!!
So, the code now looks as follows (I am posting a "smaller" version of it)
import java.io.*;
public class Ergasia4
{     public static void main (String args[])throws IOException
     {     int epilogi;
          boolean secondTry;
          Ptisi A3510,A3511,A3512,A3513;
          A3510 = new Ptisi();
          A3511 = new Ptisi();
          A3512 = new Ptisi();
          A3513 = new Ptisi();
          secondTry=false;
          for(;;)
          {     do     
               {     if (secondTry)
                    {     System.out.println ("Lathos epilogi");
                    System.out.println ("EPILOGI PTISIS");
                    System.out.println ("1. Ptisi A3510, ATH-SKG");
                    System.out.println ("2. Ptisi A3511, SKG-ATH");
                    System.out.println ("3. Ptisi A3512, ATH-SKG");
                    System.out.println ("4. Ptisi A3513, SKG-ATH");
                    System.out.println ("0. Exodos");
                    System.out.print ("Epilogi: ");
                    epilogi=my.readInt();
                    System.out.println ();
                    secondTry=true;
               while ((epilogi<0) || (epilogi>4));
               if (epilogi==0) break;
               else
               {     switch (epilogi)
                    {     case 1:
                         {     System.out.println("Ptisi A3510, ATH-SKG");
                              A3510.menu();
                              secondTry=false;
                              break;
                         case 2:
                         {     System.out.println("Ptisi A3511, SKG-ATH");
                              A3511.menu();
                              secondTry=false;
                              break;
                         case 3:
                         {     System.out.println("Ptisi A3512, ATH-SKG");
                              A3512.menu();
                              secondTry=false;
                              break;
                         case 4:
                         {     System.out.println("Ptisi A3513, SKG-ATH");
                              A3513.menu();
                              secondTry=false;
                              break;
                         default : break;
class Ptisi
     private boolean availability[];
     private long telephones[];
     public Ptisi()
     {     availability = new boolean[36]; // Do you do this somewhere?
             arxikopoiisi();
     //Displays the menu for action-selection     
     public void menu () throws IOException     
     {      //Variables
             //Shows the menu
     //Method to reserve seats
     public void kratisi () throws IOException
     {     //Variables
          //Asks the number of seats to be booked and checks for input errors          
          //Finds, if available, the first seat of the booking
          //Asks for the telephone number to be used at the booking, if a booking is to be made
                if (x>-1);
          {     i=0;
               do
               {     if (i==1) System.out.println ("Lathos arithmos tilefwnou");
                    System.out.println ("Eisagete ton arithmo tilefwnou");
                    System.out.print ("Arithmos: ");     
                    tilefwno=my.readInt ();
                    System.out.println ();
                    i=1;
               while (tilefwno<0);
          //Performs the booking, or displays an error message
                if (x>-1)
          {     for (i=x;i<(x+theseis);i++)
               {     availability=false; telephones[i]=tilefwno;
               System.out.println("I kratisi "+theseis+" thesewn egine epityxws");
               System.out.println();
          else System.out.println("Den yparxoun "+theseis+" diathesimes synexomenes theseis");
     //Method to make a cancellation
     public void akyrwsi () throws IOException
     {     //Variables
          //Asks for the first seat of the cancellation and checks for input errors
          //Asks for the total seats to be canceled and checks for input errors
          //Checks if the seats to be canceled are really booked
          //Performs the cancellation, or displays an error message
     //Method to display the % of occupancy and the seatmap
     public void emfanisi () throws IOException
     {     //Variables
          //Calculates the % of occupancy          
          //Displays of the % of occupancy
          //Creation of the seatmap
          //Display of the seatmap
//Method to initialize the array "arxikopoiisi", giving it "true" as a value
     public void arxikopoiisi ()
     {     for (int i=0;i<availability.length;i++)
          {     availability[i]=true;
My problem now is an exception in thread "main" java.lang.NullPointerException at this line:
{     availability=false; telephones[i]=tilefwno;
Any more ideas?
Regards,
philimonas

Similar Messages

  • How can I query data from XML file stored as a CLOB ?

    Hi folks,
    please see below sample of XML file, which is stored in "os_import_docs", column "document" as CLOB.
    I would like to query this XML file using some SQL select.
    How can I query data form below XML?
    <?xml version="1.0" encoding="UTF-8"?>
    <etd>
      <header>
        <AR>000000000</AR>
        <AW>0</AW>
        <CT>S</CT>
        <CU>H</CU>
        <CZ>SS48</CZ>
        <BU>4</BU>
        <CH>0032</CH>
        <CK>2012-11-01</CK>
        <CL>21:18</CL>
        <CW>225</CW>
        <CX>0</CX>
        <CF>SS-CZL18</CF>
        <DV>2</DV>
      </header>
      <account_group id="234">
        <account id="234">
          <invoice id="000742024">
            <da>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>A</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>88754515</BS>
              <AD>Mike Tyson</AD>
              <AC>Mike Tyson</AC>
              <AZ>CZ6521232465</AZ>
              <AE/>
              <CG>A</CG>
              <AL>A</AL>
              <BZ>.</BZ>
              <AH>Some street</AH>
              <AI/>
              <AF>Some city</AF>
              <AK>Kraj</AK>
              <AG>CZ</AG>
              <AJ>885 21</AJ>
              <CR>21-11-2012</CR>
              <AY>602718709</AY>
              <AV>800184965</AV>
              <AP/>
              <AO/>
              <AQ/>
              <AN/>
            </da>
            <da>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>A</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>88754515</BS>
              <AD>Mike Tyson</AD>
              <AC>Mike Tyson</AC>
              <AZ>CZ6521232465</AZ>
              <AE/>
              <CG>A</CG>
              <AL>L</AL>
              <BZ>Mike Tyson</BZ>
              <AH>Some street</AH>
              <AI/>
              <AF>Some city</AF>
              <AK>Kraj</AK>
              <AG>CZ</AG>
              <AJ>885 21</AJ>
              <CR>21-11-2012</CR>
              <AY/>
              <AV>800184965</AV>
              <AP/>
              <AO/>
              <AQ/>
              <AN/>
            </da>
            <detaildc CH="0032" AB="234" BS="11888954" BB="32" BA="CZ" AT="" CI="7077329000002340342" AU="" DU="1Z48395" CB="CZK">
              <dc>
                <AW>0</AW>
                <CT>D</CT>
                <CU>C</CU>
                <BY>31-10-2012</BY>
                <CA>25-10-2012</CA>
                <CV>8151</CV>
                <BT>12111</BT>
                <CJ>1</CJ>
                <AM>0</AM>
                <DR>PC</DR>
                <DS/>
                <DO>25-10-2012</DO>
                <DQ>18:42</DQ>
                <CE>1</CE>
                <BH>8151</BH>
                <CY>8151 SHELL MALKOVICE P</CY>
                <DP>049336</DP>
                <DT/>
                <BQ/>
                <BR>500000</BR>
                <CN>30</CN>
                <CM>030</CM>
                <BO>160,00</BO>
                <BF>38,900</BF>
                <BC>6224,00</BC>
                <BI>32,417</BI>
                <CD>B</CD>
                <BG>0,600</BG>
                <BK>31,817</BK>
                <BJ>0,000</BJ>
                <DI>8</DI>
                <BP>20,00%</BP>
                <CC>CZK</CC>
                <BM>5090,67</BM>
                <BN>1018,13</BN>
                <BL>6108,80</BL>
                <BD>5090,67</BD>
                <BE>1018,13</BE>
                <DW>6108,80</DW>
                <CO>Nafta</CO>
              </dc>
            </detaildc>
            <dt>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>T</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>11888954</BS>
              <BB/>
              <BA>CZ</BA>
              <DG>1</DG>
              <CN>30</CN>
              <CM>030</CM>
              <DF>160,00</DF>
              <DH>litr</DH>
              <DJ>20,00%</DJ>
              <DD>5090,67</DD>
              <DE>1018,13</DE>
              <DC>6108,80</DC>
              <DB>CZK</DB>
              <DA>P</DA>
              <AX/>
              <CQ/>
              <CP/>
            </dt>
            <dt>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>T</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>11888954</BS>
              <BB/>
              <BA>CZ</BA>
              <DG>2</DG>
              <CN/>
              <CM/>
              <DF>160,00</DF>
              <DH>litr</DH>
              <DJ/>
              <DD>5090,67</DD>
              <DE>1018,13</DE>
              <DC>6108,80</DC>
              <DB>CZK</DB>
              <DA/>
              <AX/>
              <CQ/>
              <CP/>
            </dt>
            <dt>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>T</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>11888954</BS>
              <BB/>
              <BA>CZ</BA>
              <DG>19</DG>
              <CN/>
              <CM/>
              <DF/>
              <DH/>
              <DJ/>
              <DD>5090,67</DD>
              <DE>1018,13</DE>
              <DC>6108,80</DC>
              <DB>CZK</DB>
              <DA/>
              <AX/>
              <CQ/>
              <CP/>
            </dt>
            <dt>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>T</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>11888954</BS>
              <BB/>
              <BA>CZ</BA>
              <DG>8</DG>
              <CN/>
              <CM/>
              <DF/>
              <DH/>
              <DJ/>
              <DD>5090,67</DD>
              <DE>1018,13</DE>
              <DC>6108,80</DC>
              <DB>CZK</DB>
              <DA/>
              <AX/>
              <CQ/>
              <CP/>
            </dt>
          </invoice>
        </account>
      </account_group>
      <footer>
        <AR>999999999</AR>
        <AW>0</AW>
        <CT>S</CT>
        <CU>T</CU>
        <CZ>SS48</CZ>
        <BU>4</BU>
        <CH>0032</CH>
        <CK>2012-11-01</CK>
        <CL>23:04</CL>
        <CW>225</CW>
        <BX>1</BX>
        <CS>7</CS>
        <BW>0000000000000610880</BW>
      </footer>
    </etd>sample - not working:
        select  x.*
        from os_import_docs d
             ,XMLTABLE('/etd/header'
                        PASSING httpuritype(d.document).getXML()
                        COLUMNS
                           response_status varchar2(50) PATH 'AR'
                        )  x
       where d.object_id = 2587058
         and rownum = 1; 
    ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 6196, maximum: 4000)Many thanks,
    Tomas

    Hello,
    many thanks for the reply. Your examples are very usefull for me.
    To answer your questions.
    An XML structure:
    /etd
        /header - repeat in each row in output
        /account_group/account
            /invoice
                /da - repeat for each details under "selected "invoice
                /detaildc/dc - the lowest level 
                /detaildn/dn - the lowest level 
                /dt - repeat for each details under "selected "invoice
        /footer - repeat in each row in outputI would like to to have a 1 row for each "record" in /detaildc section and include related nodes at higher levels.
    Please see below XML file, which is simplified file of example in first post, but includes a complete xml structure which needs to be queried in db.
    <?xml version="1.0" encoding="UTF-8"?>
    <etd>
      <header>
        <AR>000000000</AR>
        <CK>2012-10-31</CK>
        <CF>SS-CZL19</CF>
      </header>
      <account_group id="234">
        <account id="234">
          <invoice id="EI08P4000">
            <da>
              <AR>EI08P4000</AR>
              <AD>Mickey Mouse</AD>
            </da>
            <detaildc DU="1Z56655" CB="EUR">
              <dc>
                <DO>16-10-2012</DO>
                <CY>ASFINAG POST_MAUT</CY>
                <BM>1940,60</BM>
                <CO>Dalnicni znamka</CO>
              </dc>
            </detaildc>
            <detaildc DU="2Z55050" CB="EUR">
              <dc>
                <DO>17-10-2012</DO>
                <CY>ASFINAG POST_MAUT</CY>
                <BM>1328,10</BM>
                <CO>Dalnicni znamka</CO>
              </dc>
            </detaildc>
            <detaildc DU="2Z90001" CB="EUR">
              <dc>
                <DO>27-10-2012</DO>
                <CY>ASFINAG POST_MAUT</CY>
                <BM>185,10</BM>
                <CO>Poplatek</CO>
              </dc>
            </detaildc>
            <dt>
              <AR>EI08P4000</AR>
              <DG>8</DG>
            </dt>
          </invoice>
        </account>
        <account id="234">
          <invoice id="EI13T7777">
            <da>
              <AR>EI13T7777</AR>
              <AD>Mickey Mouse</AD>
            </da>
            <detaildc DU="1Z48302" CB="EUR">
              <dc>
                <DO>26-10-2012</DO>
                <CY>SANEF 07706 A 07704</CY>
                <BM>232,10</BM>
                <CO>Dalnicni poplatek</CO>
              </dc>
            </detaildc> 
            <detaildc DU="1Z48302" CB="EUR">
              <dc>
                <DO>20-10-2012</DO>
                <CY>TEST A 07704</CY>
                <BM>30,10</BM>
                <CO>Poplatek</CO>
              </dc>
            </detaildc>       
            <dt>
              <AR>EI13T7777</AR>
              <DG>8</DG>         
            </dt>
          </invoice>
        </account>
        <account id="234">
          <invoice id="EI327744">
            <da>
              <AR>EI327744</AR>
              <AD>Mickey Mouse</AD>
            </da>
            <detaildn  CI="707732 00000234" >
              <dn>
                <BY>30-10-2012</BY>
                <BM>8,10</BM>
              </dn>
            </detaildn>
            <detaildn CI="707732 00000234" >
              <dn>
                <BY>30-10-2012</BY>
                <BM>399,50</BM>
              </dn>
            </detaildn>
            <dt>
              <AR>EI327744</AR>
            </dt>
          </invoice>
        </account>
        <account id="234">
          <invoice id="EI349515">
            <da>
              <AR>EI349515</AR>
              <AD>Mickey Mouse</AD>
            </da>
            <detaildc DU="1Z56514" CB="EUR">
              <dc>
                <DO>29-10-2012</DO>
                <CY>ALLAMI AUTOPALYAKEZE</CY>
                <BM>1240,60</BM>
                <CO>Dalnicni znamka</CO>
              </dc>
            </detaildc>
            <detaildc DU="1Z56515" CB="EUR">
              <dc>
                <DO>19-10-2012</DO>
                <CY>ASFINAG POST_MAUT</CY>
                <BM>7428,10</BM>
                <CO>Dalnicni znamka</CO>
              </dc>
            </detaildc>
            <detaildc DU="1Z56515" CB="EUR">
              <dc>
                <DO>12-10-2012</DO>
                <CY>UK</CY>
                <BM>954,10</BM>
                <CO>Poplatek</CO>
              </dc>
            </detaildc>
            <dt>
              <AR>EI349515</AR>
              <DG>8</DG>
            </dt>
          </invoice>
        </account>
      </account_group>
      <footer>
        <CZ>SS47</CZ>
        <BU>4</BU>
        <CH>0032</CH>
        <CK>2012-10-31</CK>
        <CL>01:25</CL>
      </footer>
    </etd>Expected output
    AR     CK     CF             AR4             AD             DU     CB     DO             CY                     BM      CO                AR5             DG     CI             BY               BM6     CZ     BU       CH       CK7    CL
    0     41213     SS-CZL19     EI08P4000     Mickey Mouse     1Z56655     EUR     16-10-2012     ASFINAG POST_MAUT     1940,60     Dalnicni znamka        EI08P4000     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI08P4000     Mickey Mouse     2Z55050     EUR     17-10-2012     ASFINAG POST_MAUT     1328,10     Dalnicni znamka        EI08P4000     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI08P4000     Mickey Mouse     2Z90001     EUR     27-10-2012     ASFINAG POST_MAUT      185,10     Poplatek        EI08P4000     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI13T7777     Mickey Mouse     1Z48302     EUR     26-10-2012     SANEF 07706 A 07704      232,10     Dalnicni poplatek  EI13T7777     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI13T7777     Mickey Mouse     1Z48302     EUR     20-10-2012     TEST A 07704               30,10     Poplatek        EI13T7777     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI327744     Mickey Mouse                                                                      EI327744          707732 00000234     30-10-2012     8,10     SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI327744     Mickey Mouse                                                                      EI327744          707732 00000234     30-10-2012     399,50     SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI349515     Mickey Mouse     1Z56514     EUR     29-10-2012     ALLAMI AUTOPALYAKEZE     1240,60     Dalnicni znamka        EI349515     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI349515     Mickey Mouse     1Z56515     EUR     19-10-2012     ASFINAG POST_MAUT     7428,10     Dalnicni znamka        EI349515     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI349515     Mickey Mouse     1Z56515     EUR     12-10-2012     UK                      954,10     Poplatek        EI349515     8                                    SS47     4     32     41213     01:25

  • How can I hold values in a variable

    I am looking for someone to point me in the right direction - I'm somewhat new to Java, but am a dinosaur from the mainframe, and sometimes get frustrated at the amount of effort I need to go through to do something that would have been simple on the mainframe...
    I have a Swing based GUI application that I am trying to write - it uses Swing components to build a GUI interface and present data to the user. This data comes from a flat file that is XML based. The structure is as follows:
    "Main" class (establishes the GUI, etc.)
    |
    Specific class (establishes a specific page in the GUI; there are many of these)
    |
    XML Reader class - uses parsing functions to read the file; stores data into an array
    The problem is that I make an initial call to the method that parses the XML file and builds the data in the array. I can see this through my debugging tool; it is confirmed in tracing messages I have built into the program.
    I then return to the specific class, and it wants to do specific things to build the GUI pages, based on customer input. So for example, I may want to go and get information on the third record in the XML file - I pass back an index value, and it should return information. Unfortunately, the array is now empty when I return to extract the values.
    How can I hold the values in the array so that I can return and extract (and ultimately update) the values when I need them. There are initially about 25 different arrays - some Integer, Some Strings, and some String buffers. I have seen an indication that I could implmenet Serializable to do this, but it seems that this is a lot of I/O - parsing the data, then serializing it back to disk, and then reading it back every time I want to access it. I have thought about doing it through a data base, but I don't have a DBMS available currently, and this is possibly beyond my level at the moment.
    I appreciate any suggestions that you might have.
    Jerry

    The xml file that I have is something that I
    established my self. It follows the standard xml
    conventions, just straight <tag field="xyz" /> stuff.
    About as fancy as it gets is to have free form text
    t lines where I need to capture the information in a
    String buffer out of the parser. The format of the
    tag is like this:
    <comments>
    multiple lines of text
    follow...
    </comments>In that case, depending on your utilization of the data(if this is not intended to carry data around different systems) you can just serialize it to the file and after retrieve it using XMLEncoder and XMLDecoder from java.bean package.(Have a look on the javadocs for J2SE)
    If your XML is intended to be passed around different systems, you can use JAXB to bind the document to a object model, instead of parsing it yourself.
    I sem to be having issues with passing control
    between classes - As I understand it, values that you
    establish in one class must be passed along to the
    caller - there doesn't seem to be a conceopt like a
    "data section" where data can be stored for access by
    all classes that need access to it. Gosling fobid it!!!!!
    Or is there, and
    I just haven't discovered it yet.No you won't, happily there is no such a thing, once you got the hang of OO principles and design, you will see that this is not only dangerous as it adds too much complexity to the system for those mantainig the code.
    If you want data to be acessed througout the system, uniquely, there are means to do that, like Singleton pattern(GoF, 127) and Common Object Registry pattern(Software Architeture Design Patterns in Java, 423)
    But I think this is not the solution to tyour problem, as far as I understand, you get data from your XML file, that seems to have a structure repeating over the file, and you want to display it to your user.
    The firsting I would advise is to not use arrays as carriers for your data. Instead use objects that represent your data stored in collections, for example, if you have a xml file like this:
    <people>
       <person>
             <name>Jeff</name>
             <age>6</age>
       </person>
       <person>
             <name>Rage</name>
             <age>36</age>
       </person>
       <person>
             <name>Rene</name>
             <age>666</age>
       </person>
    </people>Then, have a class that hold the data for person:
    * @(#)Person.java     v1.0     02/03/2005
    import java.io.Serializable;
    * Class that stands for a person data.
    * @author Notivago     02/03/2005
    * @version 1.0
    public class Person implements Serializable {
         * The class implements java.io.Serializable, as it is
         * required for the class to be a java bean.
         * The proper way to have classes offering its data
         * to the external world is by having get/set methods
         * that handle acess to internal fields.
         * Never make the class fields public.
         * The age of the person this class represents
        private int age;
         * The name of the person this class stands for.
        private String name;
         * Vanilla constructor for the class, as required for classes to be
         * java beans. Initializes the class with age 0 and a empty name.
        public Person() {
            super();
            age = 0;
            name = "";
         * Convenience constructor that allows your bean to be created
         * with age and name set.
         * @param age
         * @param name
        public Person(int age, String name) {
            this.age = age;
            this.name = name;
         * Acessor for the age of the person.
         * @return
         *           The age.
        int getAge() {
            return age;
         * Mutator for the age of the person.
         * @param age
         *           The age to set.
        void setAge(int age) {
            this.age = age;
         * Acessor for the name of the person. 
         * @return
         *           The name of the person.
        String getName() {
            return name;
         * Mutator for the name of the person.
         * @param name
         *           The name of the person.
        void setName(String name) {
            this.name = name;
    }Get the data from the XML document, with JAXB for example, and for each person found, create and populate a bean with the data, store the bean in the colection and pass it to the user interface to be displayed. (Look at the java.util documentation)
    If you are into doing GUI, you will want to have a look in the MVC pattern, Model 2 pattern and the Swing "Separable Model" Architeture, so you learn how to make reusable decoupled GUIs. (search for MVC and Model 2 and look at the "How to use Swing Components" Documentation)
    On using swing, you can get the collection of beans and bind it to lists, tables or any other presentation form you would want. Look at the swing tutorial on how to use data model to boost your GUI.(Look at "how to use swing documentation")
    http://java.sun.com/docs/books/tutorial/uiswing/components/index.html
    But here goes 2 cents of opinion, start by the basic tutorials:
    http://java.sun.com/docs/books/tutorial/
    especially the ones on Object Orientation:
    the way things are done in Mainframe if very different as they are done on a OO language, before learning the language, you will have to learn a new mindset, so after reading the basic tutorials, it would be good you search for some good books that focus on OO thinking, a good one that does that and teaches java at the same time is:
    Head First Java
    It is a good and funny reading.
    Head First Design Patterns
    Also have a lot of good insights on OO and it comes with some patterns as a bonus.
    I understand you see this all as overcomplicated, bu once you get the hang of it, you will see that there this only another way to see things and the stability and reusability attained is worth of the effort.
    May the code be with you.

  • How can i import data to ipad from pc ?

    how can i ımport data to ipad from pc ?

    It would help if you said what sort of data you want to transfer - documents, spreadsheets, powerpoint, etc .
    In order to transfer files to the iPad you will first need one or more apps on the iPad that supports those file types - without an app the files cannot be saved (apart from as email attachments), as unlike 'normal' computers the iPad doesn't have a file system and files/documents have to be stored/associated with an app. Once you've got an app then, depending on what it is, transfer might be done via the file sharing section at the bottom of the iPad's apps tab when connected to your computer's iTunes, via wifi, email attachments, Dropbox etc.
    If you want to transfer/support Word and Excel documents then Documents To Go is one option (http://itunes.apple.com/au/app/documents-to-go-office-suite/id317117961?mt=8) and how to transfer to/from it is described on this pagehttp://support.dataviz.com/support.srch?docid=14497&pid=198 (the 'premium' version of the app also supports editing Powerpoint files instead of just viewing them)
    Apple's Pages app supports Word documents :http://itunes.apple.com/us/app/pages/id361309726?mt=8 (how to transfer files http://help.apple.com/pages/ipad/1.4/#tanb5b5c055)
    and their Numbers apps supports Excel documents :http://itunes.apple.com/au/app/numbers/id361304891?mt=8#(transferring files http://help.apple.com/numbers/ipad/1.4/#tanb5b5c582)

  • Hi everybody! How can I transpose data in numbers?

    Hi everybody! How can I transpose data in numbers?

    If you don't want to go to all the trouble of setting up formulas each time you do this, and making sure the new table is the correct dimensions in the destination table, etc, just run this Automator Service.  (Dropbox download)
    After double-clicking the .workflow package to install (you may need to click 'Download Anyway' in System Preferences > Privacy & Security) it will look something like this in your Services menu:
    After that one-time, one-minute setup, all you have to do to use it is select the range you want to transpose, choose 'Copy Transpose' from the menu, click once in a cell where you want the transposed values to appear, and type command-v or option-shift-command-v to paste.  This is similar to (though slightly different from) what one does in Excel.
    To remove or rename the Service, in Finder hold down the option key and in the menu Go > Library > Mobile Documents > com~apple~Numbers and delete or rename the way you would any item in Finder.
    You can view the short AppleScript the service contains by opening it in Automator.
    SG

  • How can I share data between WinXP Pro and Mac OS 10.8.3 via wifi

    How can I share data between WinXP Pro and Mac OS 10.8.3 via home wifi. 

    MartyP wrote:
    Or is there a problem with both OS's writing stuff to the
    ~/Home/Library folder that may be incompatible?
    Yes, big time.  Mail, for sure, has a different file/folder structure, and would not be happy.
    Plus, a number of apps (Apple and 3rd-party) are "Sandboxed."  That's a security feature, to prevent malware or bad coding from affecting things it shouldn't.  Some of their files, including the preferences files, aren't even stored in the same places!
    Or to other places I'm not aware of?
    Probably.  If you have two versions of the same app, they may or may not expect the same data setup.
    To have one User folder for both OS's would save a lot of drive space
    Not if you use some or all of woodmeister50's suggestions. 
    But I'm also not sure how I'd use Time machine with such a set up.
    Just as you do now.  By default, Time Machine backs-up everything (except things like system work files, most caches and logs, trash) for all users and all internal drives & partitions.  By default, it excludes external drives.
    You can change those defaults, of course, via TM Preferences > Options.
    See Time Machine - Frequently Asked Question #32 for details and considerations of multiple drives.
    Presently I backup with . . . clones to other HD's
    Good.   Yes, clones are different.  You need multiple "tasks" to back up multiple drives/partitions.  But once set up, that shouldn't be a big deal.

  • How can I upload date data, like 2015/03/23 to Hyperion planning 11.1.2.3 ?

    Hi all,
    how can I upload date data, like 2015/03/23 to Hyperion planning 11.1.2.3 ?
    Not necessary do it by FDM, please let me know if there is a way to do it.
    Thanks a lot in advance.

    FDM is not the best tool for doing something like this as it loads direct to Essbase and doesn't have the same support for loading text and date values that you get when loading this type of data via the Planning layer. Take a look at using the Outline Load Utility, the sage John Goodwin has a detailed description on his blog - More to life than this...: Planning 11.1.2.2.300 Outline Load Utility Enhancements Part 2 - on how to do this from a relational source although the bulk of it holds true if you were loading from a flat file.

  • How can we append data in existing flat file

    how can we append data to a existing flat file (Text file).

    just fill the itab from data which suppose to append to text file.than read text file from GUI_UPLOAD and loop on itab and with the use of read statements you may append the data.

  • How can we update data in LDAP server using PL/SQL.

    Hi,
    How can we update data in LDAP server using PL/SQL program.
    Is there any sample code for refrence.
    Thanks,
    Tarun

    Hi Justin,
    Thanks for your help. You got my correct requirements.
    Tim's example returning all the attributes of current user which is admin user. Please correct me if I am wrong.
    I have the following information:
    the admin user and password,server info , port and ldap_base for admin.
    I have uid and password for regular user, I am trying find the ldap_base for regular user, which may be different from adminuser.
    Please help me.
    Thanks,
    Edited by: james. on Jan 12, 2009 5:39 PM

  • In ADF how can i insert data in multiple table if they have foreign key

    I have started working on ADF and can anybody inform me in ADF how can i insert data in multiple table if they have foreign key,please?
    Thnak you very much.

    Hello,
    Still no luck.I am surely doing silly mistakes.Anyway,Here are my workings-
    1> student_mst (id(pk),studentname) and student_guard_mst(id(fk),guardianname)
    2> created EO from both of the tables,made id in both EO as DBSequence and an association was also generated.
    3> i made that association composite by clicking the checkbox
    4> i created 2 VO from 2 EO.
    5> put those VO in Application Module.
    6> dragged and dropped 2 VO on my jspx page and dropped them as ADF Form.
    Now what to do please?

  • How can i print data in bi publisher template across wise

    Hi,
    Please let me know how can i print data in bi publisher template across wise.
    eg.
    In my C1 field there is a data coming like
    S
    JR
    MR
    i want to print this filed
    S JR MR
    Thanx
    Arjun

    Hi ,
    Now i am able to print S JR MR horizontally.Thanx a lot for that.Now my problem is
    There is one column field which displaying value like S JR MR
    Now i am calculating a value using a function and want to display that value for each vale of above column
    For eg
    The report should display like this
    C1 C2 C3
    45 1-2-3 S JR MR
    45*1 2*45 3*45
    I have created package to make the string 1-2-3 separeate and the fuction is working fine .But unable to print value in bi
    Its displaying like this for each S JR MR
    45*1 2*45 3*45 45*1 2*45 3*45 45*1 2*45 3*45
    45*1 is in different group that should display also horizontally thats why i tried this <?for-each@cell:G_STR_ID?>
    Please help me
    Thanks in advance

  • How can I enter data in an input schedule on a member in the EPM Add-On that is not a base member?

    Hello, all,
    how can I enter data in an input schedule on a member in the EPM Add-On that is not a base member?
    E.g. I want to implement a top-down-planning scenario and I have the following hierarchy:
    Europe
         Germany
         France
         UK
         Spain
         Italy
    How can I enter a value on Europe in an input schedule in order to allocate this value afterwards?
    Thanks in advance and best regards
    Gerd

    Gerd,
    It should be something like below -
    EuropeInput
    Europe
         Germany
         France
         UK
         Spain
         Italy
    EuropeInput shall be kept out of hierarchy and should be a base level member. Users will enter the numbers in this member. In your script logic, you will make use of this member to allocate the data in Bas(Europe) i.e. Germany, France, etc.
    Effectively, after allocation the same data will be rolled up to Europe.
    Many top-down planning would use such work-around as BPC doesn't allow writing to parent node.
    Regards,
    Ashish

  • How can I import data in to the digital word generator in Multisim?

    How can I import data in to the digital word generator in Multisim?
    I just  received this comment from a friend, a RADAR engineer, who has just down loaded Multisim.  He has been using HP/Agilent software.  He has a work around using a piecewise linear voltage waveform with data imported from Excel but this is not really a good solution.  It would also be helpful to import data from Mathcad or equivalent.
    "I thought I was about to be impressed with MultiSim but it ended only in disappointment. There is a word generator in the simulation instrument panel which can drive the DAC with a waveform and it can have thousands of lines of values. I opened Excel, wrote the formula to generate the time and voltage points for a chirp, converted to DAC values in Hex and then went back to the word generator in MultiSim to load the values only to find that you have to enter each value manually. It doesn’t even allow you to paste in a list of values from a text file. I’m not going to type 5000 values by hand. If you get the chance to give feedback to National Instruments please ask them if the paste option can be added to the word generator. MultiSim is useful in many regards, but in this case, it left me with the impression that it is considerably limited in capability compared to what I’m used to."

    Hi,
    You can load your data automatically in the Multisim word generator. Follow these steps:
    - Save your data file (in excel .xslx ir .csv format) on your computer
    - Change the extension of the file to ".dp"
    - Double-click the word generator in Multisim and click on Set...
    - In the Settings dialog box, click on Load and then Accept
    - This will prompt you to select the .dp file you have on your computer, select it and you're good to go
    However, in Multisim you have the option of creating your own custom simulation analysis and instrument.
    I will try creating the instrument and send it back to you but it might take some time.
    Multisim and LabVIEW are very powerful in test automation, with the custom instruments you create for Multisim you don't need to export your data file into excel from LabVIEW (or MathCAD or other tools) and then reload it into Multisim. The test procedure is automated instead.
    Please check this reference design about automated simulation
    http://zone.ni.com/devzone/cda/tut/p/id/7825
    Here is how you can create your own custom measurement tool in Multisim and LabVIEW, but as I mentioned, I will create the word generator and come back to you anyways
    http://zone.ni.com/devzone/cda/tut/p/id/5635
    Let me know if you have any questions.
    Mahmoud W
    National Instruments

  • How can i store data in term of a tree structure

    how can i store data in term of a tree structure

    What a tree is the question. If you just want a fast access, ehats about Hashtable or dictionary classes ? The data there is structured in a tree. For a simple binary tree, you can use something like
    class Node {
    Node(Object data){
       Node left;
       Node right;
       Object data = data;
    void insert(Object data, Node parent){
      int test = data.compareTo(parent.data);
      if(test < 0 ){
        if(parent.left == null){
          parent.left = new Node(data);
        else{
          insert(data, parent.left);
      else{
        if(parent.right == null){
          parent.right = new Node(data);
        else{
          insert(data,parent.right);
    }And so build up a binary tree. The traversing methods can be found in almost any good book (pre-order, post-order, in-order), for search you have just to look at greater/smaller and descend in the tree.
    The Object data can be changed to what you want for storage, String, or primitive Numbers, Vectors ...
    Is that what you search for?

  • How can i update data in okc_k_items and csi_item_instances tables?

    How can i update data in okc_k_items and csi_item_instances tables?
    by EBS .
    Thanks.

    For csi_item_instances table, you can use the following API:
    CSI_ITEM_INSTANCE_PUB.UPDATE_ITEM_INSTANCE
    For okc_k_items, try using the following API:
    OKC_CONTRACT_ITEM_PUB.UPDATE_CONTRACT_ITEM
    Hope this helps!

Maybe you are looking for