SQL*Loader fails on EBCDIC infile  - please help!!

See excerpt from control file below.
I cannot get this control file to load correctly in 9i. This worked for years on our 7.3.4 system and still does with the same infile. The only difference is that I added the "FIX 101" that tells SQL*Loader the length of the records after talking with Oracle Support. That was not necessary in 7.3.4.
In 9i and I continually get ORA-08143 invalid month when the data in position 19 through 23 contains the value '20000000'. As you can see, I want a null value substituted for dates of '0' and '20000000'. I tested loading an ASCII file instead with a data value on '20000000' and that worked fine. Therefore, I think it has something to do with the infile being EBCDIC and/or the CHARACTERSET specification. It's as if it is ignoring the decode statement. Any ideas??
LOAD DATA CHARACTERSET WE8EBCDIC500
INFILE 'pulldoca.fil' "FIX 101"
INTO TABLE HL.DOCA
TRUNCATE
status_date POSITION(19:23) DECIMAL(9,0)
"to_date(decode(:status_date,0,null,20000000,null,
to_char(:status_date,'09999999')),'yyyymmdd')"
)

Hi,
I do not think there is anything wrong with your DECODE statement. However, I think that the value of status_date in the record identified in your log file does not have a valid month. For example if you had a status_date value of 20010001 with mask yyyymmdd then it would have an invalid month. 00 was not a valid month in your 20000000 status_date value so too is it in 20010001.
Something totally different to your reported problem is that v7.3.4 would allow a field containing spaces to be converted to a number data type. Also v7.3.4 would allow precision of declared date variables (eg: start_date date(20);). None of that is available from Oracle v8 onwards.
Cheers,
Tony

Similar Messages

  • After installing the photoshop cc app it fails launch,can anyone please help?

    After installing the photoshop cc app it fails launch,can anyone please help?

    Hi prajaktai,
    Could you please elaborate the issue?
    What exactly happens when you launch PS CC?
    Are there any errors – if so, what are they?
    Does it launch and then crash? If so, when exactly does the crash occur?
    Does it crash right after launching the application or after the product splash screen or when you use a particular feature?
    Does it crash on any specific module like Loading plugins, add-ons, fonts, etc?
    Which OS do you have?
    Please share the event viewer or console crash logs.
    ~ Arpit

  • My installation for Photoshop Elements 12 Failed. I have Windows Vista. I get an error message stating:installer failed to initialze. Please help!!

    My installation for Photoshop Elements 12 Failed. I have Windows Vista. I get an error message stating:installer failed to initialize. Please help!!

    Error "Installer Failed to Initialize" | Install desktop application | Windows

  • Loading Java Applet Failed...Anyone please help.

    I am using JDeveloper 10.1.3
    Package: c17UPackage
    Java Applet: C17UPoloTestApplet.java
    Applet Html: C17UPoloTestHtml.html
    When I run C17UPoloTestHtml.html using Embedded OC4J server the HTML pages give me this error "Applet c17UPackage.view.C17UPoloTestApplet notinited" and "Loading Java Applet Failed...".
    In the Java Console it give me this error:
    java.lang.InstantiationError: oracle.jbo.JboException
    at oracle.jbo.common.JBOClass.initLoader(JBOClass.java:93)
    at oracle.jbo.common.JBOClass.<clinit>(JBOClass.java:34)
    at oracle.jbo.common.StringManagerFactory.create(StringManagerFactory.java:112)
    at oracle.jbo.common.StringManager.getSingleton(StringManager.java:110)
    at oracle.jbo.common.StringManager.getLocalizedString(StringManager.java:313)
    at oracle.jbo.common.StringManager.getLocalizedString(StringManager.java:286)
    at oracle.jbo.common.StringManager.getString(StringManager.java:226)
    at oracle.jbo.uicli.UIMessageBundle.getResString(UIMessageBundle.java:375)
    at oracle.jbo.uicli.controls.JUNavigationBar.<clinit>(JUNavigationBar.java:188)
    at c17UPackage.view.C17UPoloTestApplet.$init$(C17UPoloTestApplet.java:30)
    at c17UPackage.view.C17UPoloTestApplet.<init>(C17UPoloTestApplet.java:33)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at sun.applet.AppletPanel.createApplet(Unknown Source)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    All the package(c17UPackage, oracle.jbo, oracle.binding, oracle.adf, com.jgoodies and com.sun) I store in the same directory as applet html(C17UPoloTestHtml.html).
    How to solve this problem? Anyone please help?
    Thanks You.

    In one of my project i tried to load applet using the <jsp:plugin> tag but failed. Since i had less time so i have not done the R&D instead i called the applet as
    <applet id="MyApplet" code="MyApplet.class\" archive=\"MyApplet.jar\" width=5 height=3/>and it worked fine for me. You can try this method.
    NOTE: My applet jar file was in the same directory of my JSP page
    Message was edited by:
    diptaPB

  • Importing to a Oracle Table from SQL Loader Fails

    Hi ,
    When I try to upload one xml file from my server to my table in oracle server using sql loader it fails at times.Some times it works perfectly.
    This is a daily process which automatically dumps data to my oracle.
    Please find the error log :
    SQL*Loader: Release 10.2.0.4.0 - Production on Thu Dec 5 04:07:32 2013
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Control File:   xmlFeedDelta.ctl
    Data File:      xmlFileNames_Delta.txt
      Bad File:     xmlFileNames_Delta.bad
      Discard File:  none specified
    (Allow all discards)
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 1000
    Bind array:     50000 rows, maximum of 256000 bytes
    Continuation:    none specified
    Path used:      Conventional
    Table XMLFEEDDELTA, loaded from every logical record.
    Insert option in effect for this table: APPEND
       Column Name                  Position   Len  Term Encl Datatype
    FILENAME                            FIRST  4000   ,       CHARACTER           
    FILECONTENT                       DERIVED     *  EOF      CHARACTER           
        Dynamic LOBFILE.  Filename in field FILENAME
    value used for ROWS parameter changed from 50000 to 63
    SQL*Loader-643: error executing INSERT statement for table XMLFEEDDELTA
    ORA-03113: end-of-file on communication channel
    SQL*Loader-2026: the load was aborted because SQL Loader cannot continue.
    Table XMLFEEDDELTA:
      0 Rows successfully loaded.
      0 Rows not loaded due to data errors.
      0 Rows not loaded because all WHEN clauses were failed.
      0 Rows not loaded because all fields were null.
    Space allocated for bind array:                 252378 bytes(63 rows)
    Read   buffer bytes: 1048576
    Total logical records skipped:          0
    Total logical records read:             1
    Total logical records rejected:         0
    Total logical records discarded:        0
    Run began on Thu Dec 05 04:07:32 2013
    Run ended on Thu Dec 05 04:08:42 2013
    Elapsed time was:     00:01:10.05
    CPU time was:         00:00:00.28
    My Control File Looks like this :
    LOAD DATA
    INFILE xmlFileNames_Delta.txt
    INTO TABLE xmlFeedDelta APPEND
    fields terminated by ','
    filename CHAR(4000),
    filecontent LOBFILE(filename) terminated by eof
    My Database version :
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE 11.2.0.2.0 Production"
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    I am not sure why this is happening at times . Any help would be appreciated.

    Hi,
    have you tried with the FILLER  command like
    LOAD DATA
    INFILE xmlFileNames_Delta.txt
    INTO TABLE xmlFeedDelta APPEND
    fields terminated by ','
    filename  FILLER CHAR(4000),
    filecontent LOBFILE(filename) terminated by eof

  • SQL Loader fails loading XML data enclosed by tag not found

    The problem I'm having is my XML tree doesn't contain all possible elements. In this example the second entry doesn't contain <age> - only the first entry will be added to the database
    Any idea of how I could solve this?
    The fields are saved as varchar2
    XML:
    <rowset>
    <row>
    <name>Name</name>
    <age>Age</age>
    <city>City</city>
    </row>
    <row>
    <name>Name2</name>
    <city>City2</city>
    </row>
    </rowset>
    LOAD DATA
    INFILE 'data.xml' "str '</row>'"
    APPEND
    INTO TABLE test
    TRAILING NULLCOLS
    dummy FILLER terminated BY "<row>",
    name ENCLOSED BY "<name>" AND "</name>",
    age ENCLOSED BY "<age>" AND "</age>",
    city ENCLOSED BY "<city>" AND "</city>"
    )

    I noticed that failure occurs when using 11g version SQL Loader. It doesn't fail when using 10g version SQL Loader.
    Delimited source data comes from:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - ProductionAnd will be loaded into
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE    10.2.0.5.0      Production
    TNS for Linux: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - ProductionMy previously used SQL Loader was from:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - ProductionIt seems that I have found the real culprit. Should I know something more?

  • Safari NOT LOADING ANY WEBPAGES...PLEASE HELP!!

    Hey Everyone,
    I’ve been having a huge problem with my safari browser ever since I got it installed onto my windows XP OS. On starting up the application, safari JUST WON’T LOAD ANY WEBPAGES. I’ve only managed to get it to load pages a few times after much struggle and this usually succeeds immediately after restarting the computer. And the other weird thing is, once fired up, it won’t fail to load any web pages until you close the browser. The other fault is that the browser keeps crushing once you mingle around with its buttons in attempt to get it to load the webpages.
    I have tried to google whether people have had similar problems with the browser but none fits into my problem. I would love for anyone to offer me any guidance on what to do next after all the below attempts to fix the problem failed;-
    -Re-installing Safari several times.
    -The same problem occurs on my Windows Vista Notebook.
    -can’t seem to find a facility to change the port number.
    PLEASE HELP!

    In Vista, Safari personal prefs and such are stored in the hidden user folder "AppData" in subfolders Local and Roaming, under "Apple" folders.
    Clean out (move or something) and let Safari start fresh, which should solve the issue.
    Not sure where XP stores files.

  • PLEASE HELP! my iPod got stolen but i got it back . and now it can be off i try to charge it and it would go to the silver apple and it would have a loading circle and it freezes |: PLEASE HELP

    PLEASE HELP! my iPod got stolen but i got it back . and now it can be off i try to charge it and it would go to the silver apple and it would have a loading circle and it freezes |: PLEASE HELP

    Hi,
    This Link contains the Steps on How to Restore your Device...
    http://support.apple.com/kb/HT1414
    Cheers,
    More Support Here:
    http://www.apple.com/support/ipod/

  • Problem in Crystal Report 11 Logon failed Vendor Code 4060- Please help

    We are using VB 6.0 as front end, SQL 2005 Express edition as a data base server back end and crystal report 11 as reporting tool on Windows XP with SP2. The problem is, In the local system where DB exits the report generates fine. But if DB in network system the report will not work and it will ask for connection information (Provide necessary information to Logon to the chosen data source). We are using ODBC to connect the report. And if we give the correct password the report will generate
    I have checked all your help file and sample code but solution not found. please help as soon as possible
    Regards
    Karthik

    Hi Karthik,
    Ensure the report is using the correct connection information. For example, the data source name, server name, database name, and user name are correct.
    In a database-client test tool, ensure that the fields, tables, and procedures used by the report exist and that SQL queries can be executed against them.
    In the Crystal Reports designer, verify that the SQL query, as shown under the Database menu Show SQL Query option, does not contain syntax errors.
    If the SQL query shown in Crystal Reports is valid, execute the same SQL query through a database-client test tool.
    Is report working fine in designer?
    Which database connection are you using?
    Regards,
    Shweta

  • SQL Loader control file script - INFILE

    Hi,
    The data stored in the file "c:/test_<yyyy>_<mm>_<dd>". The <yyyy>, <mm> and <dd> has to be from sysdate. The infile gets generated on daily basis.
    LOAD DATA
    INFILE 'c:/test_'||to_char(sysdate,'yyyy')||'_'||to_char(sysdate,'mm')||'_'||to_char(sysdate,'dd').txt'
    BADFILE 'c:/test_' || to_char(sysdate,'yyyy') || '_' || to_char(sysdate,'mm') || '_' || to_char(sysdate,'dd').bad'
    I ran the above ctl from cmd prompt, it is giving an error. It is not recognizing the || symbol as concatenation.
    How can I achieve this?
    Thanks in advance.

    Thanks Hussein.
    I placed the control script in GL_TOP directory in unix OS. I created an executable (for the control script) and scheduled this concurrent program.
    OS :- HP Tru64 UNIX - 5.1b
    Database : 9.2.0.5
    Application: Oracle General Ledger (Ver 11.5.9).
    The error I am getting if I run the command "sqlldr ...." from cmd prompt is:
    sql*Loader: Release 8.1.7.0.0
    Illegal combination of non-alphanumeric characters
    INFILE 'c:/test_' || to_char(sysdate,'yyyy'.......'
    Thanks again.

  • Sql Loader fails with newline fields

    Hi,I have a csv file delimited by "|" which is exported from MS Access. One of the fields contains a newline (e.g. notes column) which sql loader treats as beginning of new record. Can anyone tell me how to force the loader to ignore this newline.Is there a way I can tell the loader to read the optional '"' and continue with the record till it finds a closing '"'? Or is there a way to export data from access an force it to skip newlines and make a flat file with one record per line? I hate fixed length columns since it adds up pain in wrting the control files. Also the loader still fails to read the record if it encounters a newline as discussed above.
    Thanks

    Unfortunately there is no command that can make sql*loader treat two lines in a text file as one record. Some one asked tom kyte same question, see what he had to say about it:
    http://asktom.oracle.com/pls/ask/f?p=4950%3A8%3A%3A%3A%3A%3AF4950_P8_DISPLAYID%3A4972732303253
    Why don't you create a staging table where you first load the data, and then from the data inserted into this table populate your original table in the form required.
    Anwar

  • Images are not loading onto icloud from PC, please help!

    On MAC, I am having no problems accessing iCloud for contacts, calendar, etc.... that have been loaded onto iCloud from PC but I am not able to access any images on the iCloud that have been loaded from PC. I am able to access photos on the iCloud/PC that have been loaded from the MAC. All settings are good and correct on PC, photos are set up to upload to iCloud from "Uploads" folder but nothing is happening.... please help!!

    I have set up my PC and posted images into my iCloud Upload folder.  My AppleTV does not find any images. The AppleTV does find all of my music.  I think this is the same problem as the OP, only for a different iCloud Device. How can I review (on the web) the photostream images that are stored in iCloud?

  • "Apps"-Tab won't load in Creative Cloud Client - please help

    I just made the subscription for the Creative Cloud and installed the client - but it's not working.
    When I click on "Apps" to install the Adobe Apps (obviously) it just loads and loads without stopping. As a result, I'm not able to install the apps and therefore I can't use the cloud I'm paying for.
    I know I'm not the only user with this problem. Please help!
    (And I don't want any "have a chat with a professionell"-offers. I want a real solution)

    BLANK Cloud Screen http://forums.adobe.com/message/5484303 may help
    -and step by step http://forums.adobe.com/thread/1440508?tstart=0
    -and http://helpx.adobe.com/creative-cloud/kb/blank-white-screen-ccp.html
    Mac Spinning Wheel https://forums.adobe.com/message/5470608
    -Similar in Windows https://forums.adobe.com/message/5853430

  • Images not loading, maybe security issue? Please help.

    Hello,
    Need some help. I have a swf loading an XML with links to copy and images loading into a swf.
    When inside the "stars" folder the html page index.html, which loads the swf loads all the jpg and text files fine: http://the-glorybox.com/thestoryboxallstar/stars/index.html
    However, when embed a link to the swf file http://the-glorybox.com/thestoryboxallstar/stars/loadStars.swf, into the page a folder above the stars folder,
    which is just http://the-glorybox.com/thestoryboxallstar/index.html... none of the images load. Nothing loads actually. I need help with this. I figure it's a security issue with sandbox, but I created a crossdomain.xml file and added an allowDomain to my starsFA.swf file.
    What am I doing wrong??
    Please help!

    yes, i do own http://the-glorybox.com.
    i don't get why I can't seem to link to the loadStars.swf from the indexStars.html page in the folder above /stars/ i'm sure it's something simple. but i can't see why none of the swf is appearing on this page: http://the-glorybox.com/thestoryboxallstar/indexStars.html but it works fine here: http://the-glorybox.com/thestoryboxallstar/indexStars.html
    could it be permissions on my folders on the glorybox server?

  • The file just won't load into array...Please Help!

    hi i need some help in loading a binary file into an array so that i can edit the data that was saved from previous run..
    i could save the file but after that when i try to load it back to memory...i can't...ie. all the information keyed in were lost...please help
    this is the Code for the loading process...
         public static void loadAircraft (ArrayList aircraft) {
              try {
                   FileInputStream filein = new FileInputStream(".\\Data\\Aircraft.bin");
                   ObjectInputStream objectin = new ObjectInputStream(filein);
                   Aircraft craft = (Aircraft) objectin.readObject();
                   aircraft.add(craft);
                   objectin.close();
                   filein.close();
              catch (Exception e) {}
         }the above code won't load anything into memory...is there a way for overcoming this?
    inside the Aircraft class there are four different data of which they contain two differen data types.
    one of which is String and the other three are in int.
    Awaiting for reply...thanks

    yes...its some objects of an array that i am trying to load back...
    erm...i'll show you the whole code maybe...
    //to reference the swing library
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    public class SetupAircraft {
         static ArrayList aircraft;
         public static void init () {
              aircraft = new ArrayList(5);
              loadAircraft(aircraft);
         //opens up another sub group while the user
         //entered 1 as his/her option in the SetupSystem
         //menu
         public static void Setup () {
              //this will create a string that is going to be displayed
              //in the input dialog box
              String menu = "  Please select an option:  \n"
                              +"----------------------------\n"
                              +"1) Add New Aircraft\n"
                              +"2) Edit Existing Aircraft\n"
                              +"3) List Aircraft\n"
                              +"4) Delete Existing Aircraft\n"
                              +"5) Save\n"
                              +"6) Return to Main Menu\n\n"
                              +"   Enter a number between 1-6\n";
              //declare a field named option for selection through menu
              int option = 0;
              //continue the loop until the user inputs the number 6
              do {
                   //error handling for the input from the menu
                   //if the input is not integer the error is caught and
                   //reassigning option to be 0
                   try {
                        option = Integer.parseInt(JOptionPane.showInputDialog(null, menu,
                                   "Setup Aircraft", JOptionPane.QUESTION_MESSAGE));
                   catch (NumberFormatException e) {
                        option = 0;
                   //determine which option the user has chosen
                   //and enters the respective section
                   switch (option) {
                        case 1: add(aircraft);
                                  break;
                        case 2: edit(aircraft);
                                  break;
                        case 3: list(aircraft);
                                  break;
                        case 4: //delete(aircraft);
                                  break;
                        case 5: save(aircraft);
                                  break;
                        case 6:     return;
                        default: JOptionPane.showMessageDialog(null, "Please enter a number between 1-6",
                                   "Alert", JOptionPane.ERROR_MESSAGE);
                                   option = 0;
              while (true);
         public static void add (ArrayList aircraft) {
              String type = "";
              int first = 0;
              int business = 0;
              int economy = 0;
              do {
                   try {
                        type = JOptionPane.showInputDialog(null,"Enter Aircraft Type", "Prompt for Type",
                        JOptionPane.QUESTION_MESSAGE);
                        try {
                             if(aircraft.contains(type)) {
                                  JOptionPane.showMessageDialog(null, type + " already exist!",
                                  "Error", JOptionPane.ERROR_MESSAGE);
                                  type = "-100";
                        catch (Exception e) {}
                        if (type=="-100");
                        else if (type.length()==0) {
                             JOptionPane.showMessageDialog(null, "Please enter an aircraft type",
                             "Error", JOptionPane.ERROR_MESSAGE);
                        else if (!(type.startsWith("-",3))) {
                             JOptionPane.showMessageDialog(null, "Please enter the aircraft type with XXX-XXX format where X is integer.",
                             "Error", JOptionPane.ERROR_MESSAGE);
                             type = "0";
                   //catch the input error that the user has produces.
                   catch (Exception e) {
                        return;
              while (!(type.startsWith("-",3)));
              //try to ask the user for the passenger's name and if the name field contains
              //no characters at all repeat the prompt for name field until the user presses
              //Cancel.
              try {
                   first = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter First Class Capacity",
                   "Prompt for Capacity", JOptionPane.QUESTION_MESSAGE));
              catch (Exception e) {
                   String error = "For input string:";
                   if (e.getMessage() == "null") {
                        return;
                   else if (e.getMessage().startsWith(error)) {
                        JOptionPane.showMessageDialog(null, "Please enter only numbers",
                        "Error", JOptionPane.ERROR_MESSAGE);
              try {
                   business = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter Business Class Capacity",
                   "Prompt for Capacity", JOptionPane.QUESTION_MESSAGE));
              catch (Exception e) {
                   String error = "For input string:";
                   if (e.getMessage() == "null") {
                        return;
                   else if (e.getMessage().startsWith(error)) {
                        JOptionPane.showMessageDialog(null, "Please enter only numbers",
                        "Error", JOptionPane.ERROR_MESSAGE);
              try {
                   economy = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter Economy Class Capacity",
                   "Prompt for Capacity", JOptionPane.QUESTION_MESSAGE));
              catch (Exception e) {
                   String error = "For input string:";
                   if (e.getMessage() == "null") {
                        return;
                   else if (e.getMessage().startsWith(error)) {
                        JOptionPane.showMessageDialog(null, "Please enter only numbers",
                        "Error", JOptionPane.ERROR_MESSAGE);
              Aircraft newAircraft = new Aircraft (type, first, business, economy);
              aircraft.add(newAircraft);
              JOptionPane.showMessageDialog(null, "Aircraft Sucessfully Added",
              "Successful", JOptionPane.INFORMATION_MESSAGE);
         public static void edit (ArrayList aircraft) {
              String type = "";
              int first = 0;
              int business = 0;
              int economy = 0;
              do {
                   try {
                        type = JOptionPane.showInputDialog(null, "Enter Aircraft Type to Edit",
                        "Prompt for Type", JOptionPane.QUESTION_MESSAGE);
                        if (type.length()==0) {
                             JOptionPane.showMessageDialog(null,"Please enter an aircraft type",
                             "Error",JOptionPane.ERROR_MESSAGE);
                        else if (!(type.startsWith("-",3))) {
                             JOptionPane.showMessageDialog(null, "Please enter the aircraft type with XXX-XXX format where X is integer.",
                             "Error", JOptionPane.ERROR_MESSAGE);
                             type = "0";
                   catch (Exception e) {
                        return;
              while (!(type.startsWith("-",3)));
              try {
                   int edited = aircraft.indexOf(new UniqueAircraft(type));
                   Aircraft craft = (Aircraft)aircraft.get(edited);
                   try {
                        first = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter First Class Capacity",
                        "Prompt for Capacity", JOptionPane.QUESTION_MESSAGE));
                   catch (Exception e) {
                        String error = "For input string:";
                        if (e.getMessage() == "null") {
                             return;
                        else if (e.getMessage().startsWith(error)) {
                             JOptionPane.showMessageDialog(null, "Please enter only numbers",
                             "Error", JOptionPane.ERROR_MESSAGE);
                   try {
                        business = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter Business Class Capacity",
                        "Prompt for Capacity", JOptionPane.QUESTION_MESSAGE));
                   catch (Exception e) {
                        String error = "For input string:";
                        if (e.getMessage() == "null") {
                             return;
                        else if (e.getMessage().startsWith(error)) {
                             JOptionPane.showMessageDialog(null, "Please enter only numbers",
                             "Error", JOptionPane.ERROR_MESSAGE);
                   try {
                        economy = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter Economy Class Capacity",
                        "Prompt for Capacity", JOptionPane.QUESTION_MESSAGE));
                   catch (Exception e) {
                        String error = "For input string:";
                        if (e.getMessage() == "null") {
                             return;
                        else if (e.getMessage().startsWith(error)) {
                             JOptionPane.showMessageDialog(null, "Please enter only numbers",
                             "Error", JOptionPane.ERROR_MESSAGE);
                   Aircraft newAircraft = new Aircraft (type, first, business, economy);
                   aircraft.add(newAircraft);
                   aircraft.add(newAircraft);
                   JOptionPane.showMessageDialog(null, "Successfully edited aircraft\n"+type+" to capacities\n"
                   +"First: "+first+"\n"+"Business: "+business+"\n"+"Economy: "+economy,
                   "Successful", JOptionPane.INFORMATION_MESSAGE);
              catch (Exception e) {
                   JOptionPane.showMessageDialog(null,e.getMessage(),"Error",JOptionPane.ERROR_MESSAGE);
         public static void list (ArrayList aircraft) {
              JOptionPane.showMessageDialog(null, aircraft.size()+" aircraft found", "Found",JOptionPane.INFORMATION_MESSAGE);
              Object[] aircrafts;
              aircrafts = aircraft.toArray();
              for (int i=0;i<aircraft.size();i++) {
                   Aircraft a = (Aircraft) aircrafts;
                   JOptionPane.showMessageDialog(null, a, "Aircrafts" + (i+1), JOptionPane.INFORMATION_MESSAGE);
         public static void save (ArrayList aircraft) {
              try {
                   FileOutputStream fileout = new FileOutputStream(".\\Data\\Aircraft.bin");
                   ObjectOutputStream objectout = new ObjectOutputStream(fileout);
                   Object[] aircrafts;
                   aircrafts = aircraft.toArray();
                   objectout.writeObject(aircrafts);
                   objectout.close();
                   fileout.close();
                   JOptionPane.showMessageDialog(null,aircraft.size()+" aircrafts saved", "Sucessful", JOptionPane.INFORMATION_MESSAGE);
              catch (IOException e) {
                   JOptionPane.showMessageDialog(null,e.getMessage(),"Error",JOptionPane.ERROR_MESSAGE);
         public static void loadAircraft (ArrayList aircraft) {
              try {
                   FileInputStream filein = new FileInputStream(".\\Data\\Aircraft.bin");
                   ObjectInputStream objectin = new ObjectInputStream(filein);
                   Aircraft craft = null;
                   while ((craft=(Aircraft)objectin.readObject())!=null) {
                        aircraft.add(craft);
                   objectin.close();
                   filein.close();
              catch (Exception e) {
                   JOptionPane.showMessageDialog(null,e.toString());
                   e.printStackTrace();
    i think thats a bit too long..but it would explain what i am trying to save...its linking to the class Aircraft tho...
    thanks...i appreciate your help...

Maybe you are looking for