File load and save errors???

hi,i'am unable to get my file to oad and save in this class.i get 5 errors 1."Exception java.io.FileNotFoundEception must be caught or be declared in the throws clause" 2."Incompatible type for constructor.Cant convert java.io.FileInputStream to java.util.Properties" 3."Undefined variable: FileInputStream" 4."Variable 'p' is already defined in this method" 5. Incompatible type for constructor.cant covert java.io.FileInputStream to java.util.Properties.can someone please show me how to change this so it will compile and work?thanks
import cs1.Keyboard;
import publication;
import java.util.*;
import java.io.*;
public class publicationmain
public static void main(String args[])
PublicationContainer pubdatabase = new PublicationContainer();
int userchoice;
boolean flag = false;
while (flag == false)
File file = new File("publicationsList.txt");
//1st error on line below
FileInputStream inputStream = new FileInputStream(file);
//2nd error here
Properties p = new Properties(inputStream);
String myPublicationID = p.getProperty("PublicationID", defaultValue);
System.out.println("------------------------------------Publications--------------------------------");
System.out.println();
System.out.println("please Make a Selection");
System.out.println();
System.out.println("1 to add publication");
System.out.println("2 to delete publication");
System.out.println("0 to quit");     
System.out.println("3 to View all publications");
System.out.println("4 to Edit a publication");
System.out.println();
userchoice = Keyboard.readInt();
switch (userchoice)     
case 1:
String PubName;
String PricePerIssue;
String Publisher;
String Pubstatus;
String Pubtype;
int PubID;
System.out.println ("Enter Publication ID:");
PubID = Keyboard.readInt();
System.out.println("Enter Publication Name:");
PubName = Keyboard.readString();
System.out.println("Enter Publisher Name");
Publisher = Keyboard.readString();
System.out.println("Enter Price per Issue:");
PricePerIssue = Keyboard.readString();
System.out.println("Enter Publication status");
Pubstatus = Keyboard.readString();
System.out.println("Enter Publication type:");
Pubtype = Keyboard.readString();
pubdatabase.add (new publication(PubID, PubName, Publisher, PricePerIssue, Pubstatus, Pubtype));
break;
case 0:
//3rd error here
FileInputStream = new FileInputStream(file);
//4th and 5th error here
Properties p = new Properties(inputStream);
p.put("PublicationID", PubID);
p.put("PublicationName", PubName);
p.put("PublisherName" , Publisher);
p.put("PriceperIssue" , PricePerIssue);
p.put("PublicationStatus" , Pubstatus);
p.put("PublicationType" , Pubtype);
p.store(outputStream, "My Header");
flag = true;
case 2:
System.out.println ("Enter Publication ID:");
PubID = Keyboard.readInt();
pubdatabase.remove (PubID);
System.out.println ("publication: "+(PubID)+" removed");
System.out.println();
break;
case 3:
System.out.println (pubdatabase);
break;
case 4:
System.out.println ("Enter Publication to be edited by Publication ID: ");
PubID = Keyboard.readInt();
pubdatabase.remove (PubID);
String PubName1;
String PricePerIssue1;     
String Publisher1;
String Pubstatus1;
String Pubtype1;
int PubID1;
System.out.println ("Enter Publication ID:");
PubID1 = Keyboard.readInt();
System.out.println("Enter Publication Name:");
PubName1 = Keyboard.readString();
System.out.println("Enter Publisher Name");
Publisher1 = Keyboard.readString();
System.out.println("Enter Price per Issue:");
PricePerIssue1 = Keyboard.readString();
System.out.println("Enter Publication status");
Pubstatus1 = Keyboard.readString();
System.out.println("Enter Publication type:");
Pubtype1 = Keyboard.readString();
pubdatabase.add (new publication(PubID1, PubName1, Publisher1, PricePerIssue1, Pubstatus1, Pubtype1));
break;
default:
System.out.println("Incorrect Entry");
}

i'm sorry to ask this, but how long are you programming in java ? not so long, right ?
maybe you should first learn how the syntax in java is. maybe you should take a look at the java tutorial.
the errors you get are simple, so normally you should be able to solve these problems yourself.
and, if you want to post another message with the same topic, please use the already existing (started by you) threads like
http://forum.java.sun.com/thread.jsp?forum=31&thread=230202
or
http://forum.java.sun.com/thread.jsp?forum=31&thread=230185
you can reply to your postings. you do not need to start a new thread.
tobias

Similar Messages

  • File load and save issues

    I created a FileLoad and a FileSave class for a program I am writing and if I put my object declaration in my initial variable section of my class my program compiles without errors, my frame is create but the rest of my components do not load. If I place them in another section of my class and call on them with a button and actionListerner they work but If i call them multiple times my program progressively takes up more resources. Here is some sample code:
    public class BreakOutGUI extends JPanel   {
         FileSave fs = new FileSave();
         FileLoad fl = new FileLoad();
            String [] lineRead = new String[11];
    public class FileLoad {
              public String [] loadFile(){
              File loadFile = new File("HighScores.txt");
              System.out.println("FILE Load");
              if(loadFile.exists()){
                        System.out.println("FILE HERE");
                   try {
                   //FileReader input = new FileReader(AddressBook.class.getResource("AddressBook.txt").getPath().replaceAll("%20", " "));
                        FileReader input = new FileReader("HighScores.txt");
                        BufferedReader loadedFile = new BufferedReader(input);
                        while(true){
                             if(!loadedFile.ready()) break;
                             for(int x = 0; x < lineRead.length; x++)
                                  lineRead[x] = loadedFile.readLine();
                   } catch (Exception e){}
              }else {
                   FileSave fs = new FileSave();
                   fs.createNewFile();
                   System.out.println("CREATE");
                   try {
                        FileReader input = new FileReader("HighScores.txt");
                        BufferedReader loadedFile = new BufferedReader(input);
                             for(int x = 0; x < lineRead.length; x++)
                                  lineRead[x] = loadedFile.readLine();
                   } catch (Exception e){}
              return lineRead;
              public String [] getLine(){
                   return lineRead;
         }//class FileLoad
    public class FileSave{
              public void saveFile(){
               try{
                     FileWriter output = new FileWriter("HighScores.txt");
                     BufferedWriter saveFile = new BufferedWriter(output);
                     for(int x = 0; x < lineRead.length; x++){
                          saveFile.write(lineRead[x]);
                          saveFile.newLine();
                       saveFile.close();
               }catch(Exception e){
              public void createNewFile(){
                   System.out.println("CREATE NEW");
                    try{
                          FileWriter output = new FileWriter("HighScores.txt");
                          BufferedWriter saveFile = new BufferedWriter(output);
                          saveFile.write("High Scores");
                          saveFile.newLine();
                          int y = 10000;
                          for(int x = 0; x < lineRead.length; x++){
                               saveFile.write(Integer.toString(y) + " UserName");
                               saveFile.newLine();
                               y = y - 1000;
                            saveFile.close();
                    }catch(Exception e){
         }Edited by: gazotem on Dec 8, 2007 8:06 PM

    Sorry, I am new to this forum. I am currently in a beginner's java class and this is a project I am working on to create a BreakOut game.
    I was speaking about a JFrame. My IDE is Ecliplse the most recent stable build. I wrote the program under Ubuntu 7.10, with Java SDK 1.6 .
    Here is my setupFrame method of my GUI class:
    public void setupFrame(){
              f = new JFrame();
              f.setSize(400, 520);
              f.setBackground(Color.black);
              JPanel game = new JPanel();
              //f.add(new BreakOutPaint());
              f.setResizable(false);
              f.setVisible(true);
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              c = f.getContentPane();
              c.setLayout(new BoxLayout(c, BoxLayout.PAGE_AXIS));
              c.setBackground(Color.black);
              addStartMenu();
         }

  • How to load and save custom workspaces in PE7

    I've written a little utility which allows PE7 users to load and save custom workspaces. It's attached to post #1 of this thread.
    System requirements
    The utility has been tested with Windows XP Pro SP3 only. It might or might not run under Vista. It will only work with PE7 installations where the executable files are in the default places.
    Installation
    When you have downloaded the utility (it's only 199KB) you can run it from any convenient place in your system - it doesn't need to be installed as such.
    Usage
    It's pretty self-explanatory in use but here's the manual!
    Run the downloaded utility "PE7WS.exe".
    A file selection dialog appears. Choose the workspace layout file you wish to use. "LastUsed.layout" is the last used workspace (that's all you will be offered the first time you run the program). If you press Cancel at this point, the program will exit and nothing will happen.
    Once you have selected the workspace, click "Open" and Premiere Elements 7 will run, using the workspace layout you chose.
    After you exit from Premiere Elements 7, a workspace layout file save dialog will appear. If you made changes to the workspace during your Premiere Elements 7 session, you can now give the revised workspace a name and save it.
    Do not save the workspace in a different directory from that which the dialog offers!
    If you have changed an existing custom workspace, and you want to update the version previously stored, just select the name and over-write the saved workspace layout with the new one.
    If you don't want to save the workspace at all, just click "Cancel" - next time you run Premiere Elements, you can choose the "LastUsed.layout" workspace to use that last used unsaved workspace in any event.
    If you use the PE7WS utility to run Premiere Elements 7, and then you use the menu option "Window > Restore Workspace", then exit, you can either cancel the workspace saving stage, (which will mean that "LastUsed.layout" will contain that default workspace), or you could give that default workspace a name like "PE7 Default" so you can start a future Premiere Elements 7 session with the default workspace, even though you last used a custom workspace.
    If you run Premiere Elements 7 in the usual way without using PE7WS.exe, the workspace that appears will be the last used one.
    The usual disclaimer...
    The utility should be entirely safe in use, but I can't accept responsibility for any loss or damage it might cause. However, the only file manipulation is does is to workspace files in the directory that Premiere Elements 7 uses purely for the purpose - the utility doesn't go anywhere near your precious project files.

    I'm finding it very handy on my particular twin 22" monitor setup to sometimes use a one-screen layout and sometimes a two screen layout. I 'discovered' that having the timeline on the second monitor enables me to tweak edits there while having the playback full size after pressing the "full screen" button on the first monitor. Where the timeline would normally be I have the history, mixer, and other windows always open. As the second monitor is also used by another PC (the one I have the net and email etc on) using "Maxivista" monitor sharing software, I revert to single screen layout when doing stuff like exporting to DVD so I can see what is going on with the render while typing stuff like this.
    Selectable workspaces are dead handy!

  • How can I load and save text using FileReference class

    Let me start by saying I have no intention of using php and I can't wait until flash cs5 comes out with its new read/write capabilities
    I want to load and save XML files (stored on my local hard-drive) in AS3.
    I am using the FileReference class.
    Firstly I have noticed that when using FileReference.save if you replace an existing file instead of writing over the file data is appended to the end of the file. Can I make it so the file is overwritten (as it should be) or make it impossible for the user to save in such a situation.
    Secondly I want to load in text from an external file using FileReference.load I know that somehow you use FileReference.browse first to get it to work but I want to know exactly how to do it.
    I have looked for a tutorial about loading text in this manner and have not found one.
    Any help would be much appreciated especially if you could point me in the direction of a relevant tutorial
    Thanks

    the filereference class is for downloading and uploading files.
    if you want to load xml, use the xml class.
    and, if you want to write to an xml file and don't want to use server-side code, wait.

  • Load and save difficulties.

    I am new to java and do not understand how the load and save functions work.
    I have the following code and would like the load function to open selected files into text area 1 and the save function to save the contents of text area 2.
    Can anyone help me with thuis please?
    //Adding text field one
              TextArea ta1 = new TextArea(15,20);
              textPanel = new JPanel();
              textPanel.setLayout(new GridLayout(1,1) );
              textPanel.setBorder(titled);
              textPanel.add(ta1);
              container.add(textPanel, BorderLayout.NORTH);
              //Adding text field two
              TextArea ta2 = new TextArea();
              textPanel = new JPanel();
              textPanel.setLayout (new GridLayout(1,1));
              textPanel.setBorder(titled2);
              textPanel.add(ta2);
              container.add(textPanel, BorderLayout.CENTER);
              //setting the window requirements 800, 600
              setSize(800, 600);
              setVisible(true);
              setResizable(false);
              Load.addActionListener( new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        final JFileChooser fc = new JFileChooser();
                        int returnVal = fc.showOpenDialog(fc);
              Save.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        final JFileChooser fc = new JFileChooser();
                        int returnVal = fc.showSaveDialog(fc);
         });

    Example:
    // Your code
      Load.addActionListener( new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          File file = getFile('o');
    //      final JFileChooser fc = new JFileChooser();
    //      int returnVal = fc.showOpenDialog(fc);
    // end your code
      File getFile(char fcType) {
        int returnVal = 0;
        File file = null;
        JFileChooser fc = new JFileChooser();
        if ( fcType == 'o' )
          returnVal = fc.showOpenDialog(fc);
        else
          returnVal = fc.showSaveDialog(fc);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
          try {
            file=fc.getSelectedFile();
          } catch (IOException e) {
            // show exception or handle it
        return( file );
      }

  • Load and Save MySql Database

    In what way in java can I load and save a full database ,from MySql, in java , a dump operation .

    This is how I am parsing and requesting the information.. I know it's in there somewhere I just can't get the variables, do I need to add them ? It's not making much sense to me at the moment, I'm sorry !! I need to add the variables to the request somehow.. so I can receive the info, no ?
    var tab = "SQLtab";
    var filesend = "path to php file";
    var modesend = "post";
    function variableTransaction(fichier, modesend, tab, var1, var2) {
         var URLload = new URLLoader();
         var URLrequest = new URLRequest(fichier);
         var variables:URLVariables = new URLVariables();
         variables.tab = tab;
         variables.var1 = var1;
         variables.var2 = var2;
         if (modesend == "post") {
              URLrequest.method = URLRequestMethod.POST;
         } else if ( modesend == "get") {
              URLrequest.method = URLRequestMethod.GET;
         if (var1 == false && var2 == false) {
              URLload.dataFormat = URLLoaderDataFormat.VARIABLES;
              URLrequest.data = variables;
              URLload.load(URLrequest);
              URLload.addEventListener(Event.COMPLETE, loadComplete, false, 0, true);
         } else {
              URLrequest.data = variables;
              URLload.load(URLrequest);
              var receiveObject = variableTransaction(filesend, modesend, tab, false, false);

  • Illustrator "Not Responding" on load and save

    Good evening..
    We bought a new computer our graphic designer (HP Z400 quad-xeon 2.66GHz, 16GB ram, Quadro 4000 graphic card), installed with Windows 7 64-bit, set it up with the Adobe CS 5.5 Master Collection.
    The problem is with Illustrator, whereas it goes to "Not Responding" on load and save of files. The progress bar when saving stops at 5-10%, but it seems like it's still doing it's thing and it eventually goes through (15-45secs). However, I really hate getting this kind of message, moreso because his current desktop (HP XW4600, Win XP 32-bit, 3BG of RAM, Adobe CS5) is not doing this at all.
    I looked a lot of the forums, and tested what was offered and it still isn't better.
    - I removed an Add-On I had installed, no luck.
    - Removed all network drives, no luck.
    - Unchecked "Create PDF compatible file", no luck.
    Working locally is the same as on the network, which makes me believe the network is not a problem in my case. (Even switched from 100mb network connection to 1GB, which was the first thing I tried)
    Mind you, all these things I've tried were done in addition to the others, so even to total of all these wasn't helpful, and I'm still at square one.
    I'd like to add that all the other applications in the suite are behaving correctly, Photoshop, Premiere, InDesign... Everything else is working great and not freezing at all. Which is why I find this wierd that Illustrator would act like that while all the others are fine.
    Anything else I should be trying?
    Jonathan
    Edit: I checked again on his previous computer, and it seems the issue is there as well, unlike what I mentionned before, which might point to a problem with Illustrator itself, since between CS5 and CS5.5, Illustrator hasn't changed. Altough I'm not sure if it may be that the old computer is just *that* slow...

    Well, it has the Adobe PDF printer (from Adobe Acrobat) and MS XPS Document Writer (from Office), but since they weren't real printer I hadn't mentionned them. Is this what you consider Virtual printer?
    Either way, I've added a printer but it's still doing the same thing.

  • My Mozilla Firefox Browser v15.0 open then some file loading and my desktop display automatically created folder name is old Firefox data then ask me chose two

    ''duplicate of https://support.mozilla.org/en-US/questions/936244 - locking this one''
    '''My Mozilla Firefox Browser v15.0 open then some file loading and my desktop display automatically created folder name is old Firefox data then ask me chose two option 1st is Safe Mode or 2nd is Restore so i chose Restore and then open Mozilla Firefox Browser page Blank Black display page,
    How can i do solve this error plz plz plz plz help me out what you say troubleshooting,error or issue.'''

    Did you perform a Firefox Reset either by clicking the button on the Help > Troubleshooting Information page or via the Safe mode start window?
    You may have gotten the Safe Mode start window as the result of not being able to start Firefox more than once after crashes.
    See:
    *http://kb.mozillazine.org/Firefox_crashes
    *https://support.mozilla.org/kb/Firefox+crashes
    If you have submitted crash reports then please post the IDs of one or more crash reports that have this format:
    *bp-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    You can find the IDs of the submitted crash reports on the <i>about:crashes</i> page.
    *You can open the <b>about:crashes</b> page via the location bar, like you open a website.
    See:
    *http://kb.mozillazine.org/Mozilla_Crash_Reporter
    *https://support.mozilla.org/kb/Mozilla+Crash+Reporter
    If you can't open Firefox then see:
    *http://kb.mozillazine.org/Mozilla_Crash_Reporter#Location_of_crash_reports
    *http://kb.mozillazine.org/Mozilla_Crash_Reporter#Viewing_crash_reports
    "Reset" creates a new default profile with a time stamp appended to identify it and tries to recover settings like bookmarks and history and passwords and cookies and auto-fill data from the old profile, but you lose data like extensions and other customizations.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    Firefox 15+ versions will move the old profile folder to an "Old Firefox Data-##" folder on the Desktop that gets a number appended if you use reset more than once, so you can no longer use the profile manager to revert to the old profile.

  • Loading and with error message :COLLECTION in SOURCE SYSTEM ENDED

    Hi,
    Facing problem with master data object while loading and with error message :COLLECTION in SOURCE SYSTEM ENDED
    This load is getting failed every day. It is a full load and records are getting transferered and added.
    when we check in details tab in RSMO all data packets in processing is green but in extraction some of the data selection scheduled are in yellow.We are changing QM status to green as records are added.
    Version i am using is BW 3.5
    Please let me know what will be the problem???
    Thanks,
    Edited by: lokesh thonsyd on Feb 18, 2009 8:55 AM

    First try to find out the reason for the load failure. Once you fix this, do a manual run of the infopackage and when successful you can continue with the rest of process chain.
    Sometimes, it doesn't help to just set a request to green status in order to run the process chain from that step on to the end.
    You need to set the failed request/step to green in the database as well as you need to raise the event that will force the process chain to run to the end from the next request/step on.
    Therefore you need to open the messages of a failed step by right clicking on it and selecting 'display messages'.
    In the opened popup click on the tab 'Chain'.
    In a parallel session goto transaction se16 for table rspcprocesslog and display the entries with the following selections:
    1. copy the variant from the popup to the variante of table rspcprocesslog
    2. copy the instance from the popup to the instance of table rspcprocesslog
    3. copy the start date from the popup to the batchdate of table rspcprocesslog
    Press F8 to display the entries of table rspcprocesslog.
    Now open another session and goto transaction se37. Enter RSPC_PROCESS_FINISH as the name of the function module and run the fm in test mode.
    Now copy the entries of table rspcprocesslog to the input parameters of the function module like described as follows:
    1. rspcprocesslog-log_id -> i_logid
    2. rspcprocesslog-type -> i_type
    3. rspcprocesslog-variante -> i_variant
    4. rspcprocesslog-instance -> i_instance
    5. enter 'G' for parameter i_state (sets the status to green).
    Now press F8 to run the fm.
    Now the actual process will be set to green and the following process in the chain will be started and the chain can run to the end.

  • Load and Save a game in director

    hi, i would like to have the option to load and save a game
    that i have created in Director MX 2004. But, I'm unsure what
    script to attach to my LOAD and SAVE buttons. Was wondering if sum1
    has an idea as to what the lingo script might be?
    thanks
    corry

    You can find my reply to this cross-post in the
    Director
    Online forum.

  • How do I load and save to my iMac a dvd purchased elsewhere?

    how do I load and save to my iMac a dvd purchased elsewhere?  Thank you.

    The mods here are adverse to mentioning software to duplicate commercial media, which is called "ripping." However, you can search outside of this forum for the software you need.

  • My files open and save two times

    Hi All,
    See my below script, when I run this script in my InDesign files within folders containing subfolders it open and save my folder files twice and subfolder files once.
    Could anybody please help me out why my folder files open and save twice. Subfolder code is working fine.
    Thanks,
    Mon
    See my below js code below.
    //my script starts
    var myFilePath = Folder.selectDialog("Please choose InDesign file folder");
    myFilePath = new Folder ([myFilePath]);
    myFilePathContents = myFilePath.getFiles("*.indd");
    mySubFolders(myFilePath);
    var myDocument = app.documents[0];
    for (var j = 0; myFilePathContents.length > j; j++) {
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;
    var myDocument = app.open(myFilePathContents[j]);
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    var myDoc = myDocument.layers.item(0);
    myDoc.printable=false
    app.activeDocument.close(SaveOptions.yes);
    mySubFolders(myFilePath);
    function mySubFolders(theFolder) {
    var myFileList = theFolder.getFiles();
    for (var i = 0; i < myFileList.length; i++) {
    var myFile = myFileList[i];
    if (myFile instanceof Folder){
    mySubFolders(myFile);
    else if (myFile instanceof File && myFile.name.match(/\.indd$/i)) {
    myFilePathContents.push(myFile);
    //my Script end

    folder
    ├── a.indd
    ├── b.indd
    └── subfolder
        ├── c.indd
        └── d.indd
    Hi, I run your code to folder like above,it open documents such as
    "a.indd, b.indd, a.indd, b.indd, c.indd, d.indd"
    a and b open twice.
    so fix code
    myFilePath = new Folder (myFilePath); // remove bracket for 'myFilePath'
    myFilePathContents = new Array(); // remove getting .indd, they are added later in mySubFolders()
    mySubFolders(myFilePath); // remove 2nd mySubFolders(), why run twice?
    and then, run code and documents will open like
    "a.indd, b.indd, c.indd, d.indd"
    mg

  • Load and save text file???

    hi,i've this program works as far as i know.what i need to do now is load the file when the program starts and saves any updates made when i exit the program to the text file called "PublicationList.txt" how can i do this?i dont know where to start.if someone can show me the code to put in so it works that would be what i need please.thanks alot if you can help.
    The text file look contains the information as so:
    PubID 1 Pubname Times Pubtype National Pub UM Status A PPR 50
    PubID 2 Pubname Guardian Pubtype National Pub UM Status A PPR 60
    PubID 3 Pubname Sun Pubtype National Pub UM Status A PPR 30
    public class publication
    public int PublicationID;
    public String publicationname;
    public String publisher;
    public String PricePerIssue;
    public String pubstatus;
    public String publicationtype;
    public publication(int NewPublicationID, String Newpublicationname, String Newpublisher, String NewPricePerIssue, String Newpubstatus, String Newpublicationtype)
    PublicationID = NewPublicationID;
    publicationname = Newpublicationname;
    publisher = Newpublisher;
    PricePerIssue = NewPricePerIssue;
    pubstatus = Newpubstatus;
    publicationtype = Newpublicationtype;
    public String toString ()
    String pubreport = "---------------------------Publication-Information-----------------------------\n\n";
    pubreport += "Publication ID:" PublicationID" Publication Title: " publicationname"\n";
    pubreport += " publisher: " publisher " price Per Issue: " PricePerIssue"\n";
    pubreport += " publication Status: " pubstatus " publication Type: " publicationtype"\n";
    return pubreport;
    public void SetPublicationID(int PubID)
    PublicationID = PubID;
    public int GetPublicationID()
    return PublicationID;
    public void Setpublicationname(String pubname)
    publicationname = pubname;
    public String Getpublicationname()
    return publicationname;
    public void Setpublisher(String Pub)
    publisher = Pub;
    public String Getpublisher()
    return publisher;
    public void SetPricePerIssue(String PPI)
    PricePerIssue = PPI;
    public String GetPricePerIssue()
    return PricePerIssue;
    public void Setpubstatus(String Status)
    pubstatus = Status;
    public String Getpubstatus()
    return pubstatus;
    public void Setpublicationtype(String Pubtype)
    publicationtype = Pubtype;
    public String Getpublicationtype()
    return publicationtype;
    import java.util.*;
    import publication;
    public class PublicationContainer
    LinkedList PubList;
    public PublicationContainer()
    PubList = new LinkedList();
    public int add (publication newpublication)
    PubList.addLast(newpublication);
    return PubList.size();
    private class PubNode
    public publication pubrecord;
    public PubNode next;
    public PubNode (publication thepublicationrecord)
    publication p = thepublicationrecord;
    next = null;
    public String toString()
    return PubList.toString();
    public void remove(int PubID)
    PubList.remove(PubID);
    public publication get(int PubID)
    return (publication)PubList.get(PubID);
    public void set(int PubID,publication newpublication)
    PubList.set(PubID, newpublication);
    import cs1.Keyboard;
    import publication;
    import java.util.*;
    public class publicationmain
    public static void main(String args[])
    PublicationContainer pubdatabase = new PublicationContainer();
    int userchoice;
    boolean flag = false;
    while (flag == false)
    System.out.println("------------------------------------Publications--------------------------------");
    System.out.println();
    System.out.println("please Make a Selection");
    System.out.println();
    System.out.println("1 to add publication");
    System.out.println("2 to delete publication");
    System.out.println("0 to quit");
    System.out.println("3 to View all publications");
    System.out.println("4 to Edit a publication");
    System.out.println();
    userchoice = Keyboard.readInt();
    switch (userchoice)
    case 1:
    String PubName;
    String PricePerIssue;
    String Publisher;
    String Pubstatus;
    String Pubtype;
    int PubID;
    System.out.println ("Enter Publication ID:");
    PubID = Keyboard.readInt();
    System.out.println("Enter Publication Name:");
    PubName = Keyboard.readString();
    System.out.println("Enter Publisher Name");
    Publisher = Keyboard.readString();
    System.out.println("Enter Price per Issue:");
    PricePerIssue = Keyboard.readString();
    System.out.println("Enter Publication status");
    Pubstatus = Keyboard.readString();
    System.out.println("Enter Publication type:");
    Pubtype = Keyboard.readString();
    pubdatabase.add (new publication(PubID, PubName, Publisher, PricePerIssue, Pubstatus, Pubtype));
    break;
    case 0:
    flag = true;
    case 2:
    System.out.println ("Enter Publication ID:");
    PubID = Keyboard.readInt();
    pubdatabase.remove (PubID);
    System.out.println ("publication: "+(PubID)+" removed");
    System.out.println();
    break;
    case 3:
    System.out.println (pubdatabase);
    break;
    case 4:
    System.out.println ("Enter Publication to be edited by Publication ID: ");
    PubID = Keyboard.readInt();
    pubdatabase.remove (PubID);
    String PubName1;
    String PricePerIssue1;
    String Publisher1;
    String Pubstatus1;
    String Pubtype1;
    int PubID1;
    System.out.println ("Enter Publication ID:");
    PubID1 = Keyboard.readInt();
    System.out.println("Enter Publication Name:");
    PubName1 = Keyboard.readString();
    System.out.println("Enter Publisher Name");
    Publisher1 = Keyboard.readString();
    System.out.println("Enter Price per Issue:");
    PricePerIssue1 = Keyboard.readString();
    System.out.println("Enter Publication status");
    Pubstatus1 = Keyboard.readString();
    System.out.println("Enter Publication type:");
    Pubtype1 = Keyboard.readString();
    pubdatabase.add (new publication(PubID1, PubName1, Publisher1, PricePerIssue1, Pubstatus1, Pubtype1))
    break;
    default:
    System.out.println("Incorrect Entry");
    }

    public void readFile()
         BufferedReader br = new BufferedReader( new FileReader("PublicationList.txt") );
         String row;
         while( (row = br.readLine() ) != null)
              StringTokenizer st = new StringTokenizer(row," ");
              String temp = st.nextToken();
              String pubid = st.nextToken();
              temp = st.nextToken();
              String pubname = st.nextToken();
              temp = st.nextToken();
              String pubtype = st.nextToken();
              temp = st.nextToken();
              String pub = st.nextToken();
              temp = st.nextToken();
              String status = st.nextToken();
              temp = st.nextToken();
              String ppr = st.nextToken();
              // now you have in the Strings the values you needed
              // so what you want to do now
         } // read next line
         br.close();
    }try the writing on your own.
    tobias

  • SOAP to FILE using BPM to catch exception and save error into the table

    Hi All
    My scenario SOAP to FILE using BPB is working fine but now I have a requirement to catch an exception if something wrong happened on a runtime and save it into the tracking table, is that possible, if it is please point me to the similar step by step scenario.
    Thanks in advince,
    Yonela

    Yonela:
    As your original requirement is to save the eorr data into your database table, however, you was mis-leaded to alerting field.
    You are using BPM now, then that is the reason that I suggested to use excpetion branch.
    It does not matter SOAP to File seneario, it does not have to be SAP - RFC scenario, your BPM willl interact with database system.
    First you have block which include all the steps that possible generate exception: like Transformation step, and your final Aync send step (which will send data to file).
    Secondly, define a exception handler for that block.
    3. Modify each steps that posssible generate exception: e.g. transformation step, send step, add exception handler to them.
    4. Create exception branch in side the block
    5. Add another send step inside your exception branch, which will call RFC, RFC will write data to your table.
    6. If you want, you can add a control step in exception branch to trigger a alert, or terminate current process.
    At run time, any steps that trigger exeption,will cause your exception branch executed, and RFC will be called to insert data into your database table.
    Regards
    Liang

  • Load and save a cluster

    I have a cluster of data that indicates tests failed.  At the beginning of the main VI, I want to check if the file exists, if not create it, and if it does, read it.  This file will be my saved cluster, indicating the tests that have previously failed. 
    I am using open/create/replace datalog and am having a problem with the cluster elements always becoming zero. 
    I also am trying to save the cluster to the file, every time a test fails.  This does not seem to work either. 
    Is datalog sub vis the easiest thing to use here?  Should I be using something other than a cluster?
    Thanks
    metzler CLAD
    Solved!
    Go to Solution.
    Attachments:
    loading cluster.vi ‏18 KB
    save cluster.vi ‏12 KB

    I was planning on the load vi to create the file, if the folder vi created the folder, the file does not exist and the no error case structure should run, and create the file,     
    You wrote:     "But there is a problem with your logic.  Why do you call it an error if the folder exists?  When loading, you would hope that the folder does exist.  So your error cases are backwards."
    I'm sorry, I omitted the create folder from the vi, the error of which is connected to the loading cluster vi error out terminal (revised attached).  If the folder does not exist, there is no error, the folder is created, the no error case structure will then create the history.dat file, and insert the cluster with all zeros. 
    You wrote:  "In your save vi, you have to set the operation input to open/create/replace to "replace or create".  The first time you write, the datalog will be created and the data will be written."
    I was planning on the load cluster vi (no errror case) to create the file.   I then wanted the cluster to be created and written to the file. 
    I tried using the save cluster vi to create or replace the cluster, and it worked like you said.  I then loaded the cluster, but my path was wrong.  After that was fixed, it worked. 
    Thanks for your help.
    metzler CLAD
    Attachments:
    working loading cluster.vi ‏17 KB

Maybe you are looking for

  • Ipod 80gb  won't sync with itunes

    I bought an 80GB yesterday. When I connected it to my computer, it said i could not sync my iPod with my itunes b/c i was running itunes version 7.3 and i needed version 7.4 or later. When i went to download version 7.7 or whatever the latest version

  • How do i put music files on my cloud

    im trying to upload music files to my cloud but i dont know how

  • Windows 8.1 x64 error 0x80070002 While System Restore

     Today, I downloaded a file while Widows Defender was updating and it did not warn me about a virus. Now when I try to open Widows Defender, it says Windows cannot find 'C:\Program Files\Windows Defender\MSASCui.exe' so I tried to restore. then when

  • Photo Frame DPFC 1000

    Contemplating purchase of this model but found the description of screen size somewhat confusing: "Screen Size : LCD screen size: 10.1" (measured diagonally)Actual viewable size 9.1" (measured diagonally)" What does that mean? Thanks. Solved! Go to S

  • Black not printing

    Recently printer has stopped printing black.  It was almost out of black ink so I changed the black cartridge.  I had already changed the color cartridges within the past couple of weeks.  I have changed them many times and never had this happen.  Co