Trying to create a simple database program.....help, please

I am trying to create a database and I am having trouble gettig my code correct..........I think I am on the right track but I haven't a clue from this point, can anyone point me in the right direction as far as getting my program to have a master file and a transaction file and be able to manipulate the data........records.
import java.awt.*;
import java.applet.*;
public class recordsApplet
// Declare variables
String lstName;
String frstName;
Int socSec;
String street;
String city;
String state;
Int zip;
float rate;
Int numofdep;
//The buttons =
Button Submit = new Button("Add");
Button Change = new Button("Change");
Button Delete = new Button("Delete");
submit.addActionListner(this);
Change.addActionListener(this);
Delete.addActionListener(this);
//get input from users
System.out.println("Last Name:")
lstName = dataIn.readline();
System.out.println("First Name:")
frstName = dataIn.readline();
System.out.println("Social Security #:")
socSec = dataIn.readline();
System.out.println("Last Name:")
street = dataIn.readline();
System.out.println("Last Name:")
city = dataIn.readline();
System.out.println("Last Name:")
state = dataIn.readline();
System.out.println("Last Name:")
zip = dataIn.readline();
System.out.println("Rate of Pay:")
rate = dataIn.readline();
System.out.println("Number of Dependants:")
numofdep = dataIn.readline();
public void main(String[] args)
//store the information in a text file
try
output = DataOutputStream(new FileOutputStream("mocdb.txt"));
catch(IOException er)
system.exit(0)
//Print fields to text file
String arg = e.getActionCommand();
String code;
if (arg == "Submit")
code = "A";
elseif
code = "C";
else
code = "D";
try
output.writeUTF(code);
output.writeUTF(lstName.getText());
output.writeUTF(frstName.getText());
output.writeUTF(socSec.getText());
output.writeUTF(street.getText());
output.writeUTF(city.getText());
output.writeUTF(state.getText());
output.writeUTF(zip.getText());
output.writeUTF(rate.getText());
output.writeUTF(numofdep.getText());
catch(IOException c)
System.exit(1);
//Retrieve record from file
System.out.println("Last Name:")
lstName = dataIn.readline();
System.out.println("First Name:")
frstName = dataIn.readline();
try
record = new DataInputStream(new FileInputStream("mocdb.txt");
catch(IOException c)
system.exit(2)
//Check first and last name and get file
//Change data in file
//Delete the data in file

Sorry, but your question has nothing to do with JavaHelp. Please use another forum.
/Mauritz

Similar Messages

  • I am trying to create a simple animated gif in Photoshop. I've set up my frames and want to use the tween to make the transitions less jerky. When I tween between frame 1 and frame 2 the object in frame two goes out of position, appearing in a different p

    I am trying to create a simple animated gif in Photoshop. I've set up my frames and want to use the tween to make the transitions less jerky. When I tween between frame 1 and frame 2 the object in frame two goes out of position, appearing in a different place than where it is on frame 2. Confused!

    Hi Melissa - thanks for your interest. Here's the first frame, the second frame and the tween frame. I don't understand why the tween is changing the position of the object in frame 2, was expecting it to just fade from one frame to the next.

  • Everytime I open lightroom I get a pop up message saying "Lightroom encountered an error when reading from its preview cache and needs to quit" and it closes. Ive already tried reinstalling, nothing seems to work. Help please!

    Every time I open lightroom I get a pop up message saying "Lightroom encountered an error when reading from its preview cache and needs to quit" and it closes. Ive already tried reinstalling, nothing seems to work. Help please!

    Open the folder containing your catalog. In that folder you will find another folder with the extension .lrdata, and you need to delete that folder. After you do that, Lightroom should start normally and will create a new preview cache.

  • When I try to install Itunes, I get this error: (translated from Norwegian) There was a network error while trying to read from the file: C: \ windows \ installer \ iTunes.msi I have tried many times to reinstall, but nothing helps, please help me.

    When I try to install Itunes, I get this error: (translated from Norwegian) There was a network error while trying to read from the file: C: \ windows \ installer \ iTunes.msi I have tried many times to reinstall, but nothing helps, please help me.

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • I have an ipod touch that continues to have a black screen with the white apple on it. It won't shut off and is completely frozen. This happened when we tried to restore it last night. Help please!!

    I have an ipod touch that continues to have a black screen with the white apple on it. It won't shut off and is completely frozen. This happened when we tried to restore it last night. Help please!!

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar

  • All my data on my phone got deleted so I restored it through Itunes and now my IMessage will not recieve nor send out messages through my phone number but my email. I've tried alot but non is really working, help please !!

    All my data on my phone got deleted so I restored it through Itunes and now my IMessage will not recieve nor send out messages through my phone number but my email. I've tried alot but non is really working, help please !!

    Ok. You don't have to select your number. Just check your email under your "grey" number and then at the bottom of this page you will see the option "Start new conversations from". Select your number.

  • Trying to create a simple example. Need Help!

    I'm trying to create a very simlpe examlpe using Swing components to illustrate a MVC architecture.
    I have a JFrame containing a JTree and a JButton.
    What I'd like to happen is when I click the JButton the JTree model is changed in some fashion and the the view is refreshed due to the models change.
    If anyone out there has a simple example of any MVC architecture involving Swing components I'd love to see it.
    Thx

    Sure, look at any of the Sun tutorials. For example, look in your API documentation for JTree; it has a link to a tutorial about how to use JTree.

  • Creating a simple database search

    Hi
    I'm being dragged kicking and screaming into site development
    by the needs of an important customer, and I'm trying to create a
    very simple search of a database.
    I'm using DW CS4 with PHP & MySQL on a Mac (Leopard)
    using MAMP.
    I've set up two pages for the task.
    1) a HTML page with a form using the 'GET' method
    2) a PHP page with the Recordset to filter 'postcode' 'begins
    with' using the 'URL Parameter' and 'postcode', and sort by
    'company' 'Ascending'
    Running a test in the Recordset works great.
    When testing in a browser however (Firefox and Safari), the
    post code appears in the URL string when arriving at the results
    page, but no results show.
    When I don't apply a filter in the Recordset, all records
    display in the results page perfectly.
    I'm going even more grey (gray?) so any help and advice would
    be greatly appreciated.
    Many thanks.

    I've sorted it.

  • Safari 5.0.6 repeatedly crashes.  MacBook Pro 10.5.8  I've emptied cache and reset to no avail.  I've tried solutions found in other threads.  Help, please.

    Safari 5.0.6 repeatedly crashes.  MacBook Pro 10.5.8  I've emptied cache and reset to no avail.  I've tried solutions found in other threads but the more advanced don't seem to apply to me. Help, please.

    Not sure what other tests they could run for me. I've pretty much run all the tests I can using Drive Genius and Tech Tool Pro 5. Is there anything they use that I don't know about??

  • When i go in my settings on my ipod touch 3gen it says no wi-fi as in i cant connect to any wi-fi at all i tried to restore but did not work HELP PLEASE

    when i go in my settings on my ipod touch 3gen it says no wi-fi as in i cant connect to any wi-fi at all i tried to restore but did not work HELP PLEASE

    See:
    iOS: Wi-Fi or Bluetooth settings grayed out or dim
    If not successful, an appointment at the Genius Bar of an Apple store is usually in order.
    Apple Retail Store - Genius Bar

  • "Bluetooth: Not Available" problem created by software update; need help please?

    I ran a regular software update as prompted by my iMac to get to 10.6.8, and now have "Bluetooth: Not Available" with squiggly line thru it.  I've tried an SMC, updated software to 10.8.4...no availability of my Bluetooth to work the magic mouse, or any ability to access Bluetooth in System Preferences...help please?

    You say you have "tried an SMC."  Reset the SMC nd PRAM again.
    Barry
    P.S.  It is unlikely that the update had anything to do with the missing Bluetooth.
    Barry

  • Error whilst trying to download itunes....Help please.

    When I click to install it, I get so far then this error comes up; Can anybody help please? (When replying, please put in simple terms as I'm not very technical!) Thanks

    So the copy & paste of the error message didn't work, but here' what it says;
    "The installer encounted errors before iTunes could be configured. Errors occured during installation. Your system has not been modified"

  • Can't create see through text! Help please

    I am very new to illustrator so please forgive me I am using CS4 on windows. I have followed all of the sugestions on this site (this is the exact effect that I am seeking!) and for the life of me none of it works.http://www.proficiografik.com/2010/02/08/building-a-hole-see-through-t ext-or-object-in-adobe-illustrator.html
    So I am in search of help.I've worked in one layer, have tried a layer  for the color box and another for the text, I have tried grouping the text box with the color box as well. I figure there is a step in the inital layout that I am missing, but I'm not sure. Help please!

    Lorranne,
    When you have all three objects in the right order you should see:
    A) The live Type (or outlined type) in black (san diego),
    B) The intermediate shape, partly covered by the Type (the blue rectangle),
    C) The image (the steely look).
    Is that what you see? I see that.
    If you select A) and B), by clicking or selecting in the Layers palette, what do you see in the Transparency palette?
    If you then tick Make Opacity Mask, what do you see in the Transparnecy palette (both Clip and Invert Mask should be unticked), and what do you see on the Artboard?
    Edit: Edited after seeing the video.
    By the way, it makes no difference whether the image is embedded (as you mention) or linked.

  • My iphone 4 suddenly turns black and unresponsive. I tried to reset but nothing happened. Help please

    my iphone 4 suddenly turns black and unresponsive. I tried to reset but nothing happened. Help please

    See Here for
    Frozen or unresponsive iPhone
    Try this First...
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear...
    Usually takes about 15 - 20 Seconds... ( But can take Longer...)
    Release the Buttons...
    http://support.apple.com/kb/ht1430

  • Trying to do something simple... help?

    Hey guys,
    I am relatively new at flash cs3 & action script, and as
    you would imagine I am hitting a big roadblock in trying to make a
    clickable banner. I can get the animation down just fine, but when
    it comes to getting some of my invisible buttons to work, I am out
    of answers... But I'm sure the answer is something I am just not
    seeing.
    OK heres the problem...
    I am trying to make a banner that fades in and out text
    (links)... The text in the first layer fades out and the text in
    the second layer fades in. The text on both layers is occupying the
    same spot. Simple animation. Now the problem occurs when i try to
    add invisible linkable buttons to both layers... What winds up
    happening is that the first layer fading in no longer is clickable,
    but second layer works fine (everything clicks and links fine.) If
    I delete the second layer fade, then my buttons on the first layer
    start working again. Any ideas?
    here is the AS I am using for my buttons:
    Please, any help would be well appreciated!

    Fading (using _alpha) won't remove the object from the stage,
    so if they are in the same spot it's obviously choosing to carry
    out the action of the object on top.
    Bit hacky but you try using swapDepths on the butt's each
    time you want the action to change, thereby bringing the correct
    one to the top.
    butt1.swapDepths(butt2);

Maybe you are looking for

  • Same Photoshop CS2 activation issue with new installer also.

    Dear Adobe support team, we have downloaded the Photoshop cs2 from the link http://www.adobe.com/downloads/cs2_downloads/index.html. As per your suggestion I un-installed the older version and installed new version and tried to activate the product.

  • ADF BC / JBO-25009 BlobDomain / file upload problem

    That's terrible problem, what time the Oracle is planning to solve it for? else what can we do? Mucahid Uslu

  • Time machine + restore all messed up

    I restored 10.6 to my MacBook pro and was uploading my old files from my old MacBook to it and it said I needed to update after the transfer but it wasn't lion on there it was still 10.6 and when I updated 4 packets and restarted it froze on a blue s

  • NDATA: How to mask special characters?

    Hello, using NDATA functionality there is a problem if search strings contain special characters like ( or ) or a comma etc. Is it possible to mask the search term? Otherwise there will be an error like "DRG-50901: text query parser syntax error". Ex

  • Color  settings issue

    I am using CS3 under Vista Ultimate. I'd be grateful for help with a couple of problems: 1. When I customise my color settings the customisarion is not sticking - that is, when I save the customisation, close the settings box and reopen it - the sett