Ask Experts Questions for FREE Help !
Ask
    kokoaz's Avatar
    kokoaz Posts: 1, Reputation: 1
    New Member
     
    #1

    Jan 1, 2011, 05:23 AM
    Write a JAVA application in a client/server environment.
    Write a JAVA application that allows users to update their personal information in a database in a client/server environment.

    Windows:
    Window 1:
    Window1 should allow the user to select between two options ADD or UPDATE. It should contain two buttons and based on the user selection the user should be prompted with either Window2 or Window3.

    Wnidow2: ADD
    If the user selects ADD from the first window then he/she should be prompted by window2, which contains the following fields:
    • STD ID
    • First Name
    • Last Name
    • Age
    • Gender
    When the user fills all fields and clicks on the button ADD, then all field values should be written through a socket to the server class that receives them and pass them to the DB class which in turn adds them to the table/Sheet.
    To add a record to the DB table(users) , then use the following code:

    String query = "insert into users values('1234','Mohammad','Ahmad','50','M')";
    try {
    Statement stmt = DB_Conn.createStatement();
    int rs = stmt.executeUpdate(query);
    } //end try


    Wnidow3: Update

    If the user selects UPDATE from the first window then he/she should be prompted by window3, which contains the following fields:
    • STD ID
    • First Name
    • Last Name
    • Age
    • Gender
    When the user fills the fields and clicks on the button UPDATE, then all field values should be written through a socket to the server class that receives them and pass them to the DB class which in turn updates an existing record with the new values.
    If the user wants to update an existing record then when the user fills the form fields the STD ID field value must match the value of an existing record in the DB. Your program should only update that record in the DB
    To update an existing record to the DB table (users) , then use the following code:
    String query ="UPDATE users SET age=100 WHERE name='A' ";
    try {
    Statement stmt = DB_Conn.createStatement();
    int rs = stmt.executeUpdate(query);
    } //end try

    Important notes and guidelines.
    1. You should use Access DB no EXCEL
    2. The database name should be second.mdb
    3. The DB should contain one table called “users” with the following fields
    a. Std_id
    b. First_name
    c. Last_name
    d. Age
    e. Gender
    4. How to setup the DB System name
    a. Go to Control Panel >> Administrative Tools >> Data Sources (ODBC)
    b. Go to System DSN tab
    c. Click on Add
    d. Select Microsoft Access Driver (*.mdb) and click on Finish
    e. In Data Source Name insert ABC
    f. Click on SELECT and select your database “Second.mdb” created in step 2
    g. Click OK
    Curlyben's Avatar
    Curlyben Posts: 18,514, Reputation: 1860
    BossMan
     
    #2

    Jan 1, 2011, 05:26 AM
    Thank you for taking the time to copy your homework to AMHD.
    Please refer to this announcement: https://www.askmehelpdesk.com/financ...-b-u-font.html

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Java code for client server in LAN computres [ 2 Answers ]

I want java code for client server for many computrs in LAN.

Attorney-client confidentiality and the environment [ 2 Answers ]

Can a attorney-client confidentiality prevent attorney form stopping his client from an impending environmental disaster?

Program in java to transfer from client to server by using UDP [ 1 Answers ]

How to transfer a file from client to server using UDP

Client server program in java [ 1 Answers ]

have a problem about writing client-server program. I want to write two (using TCP and UDP) different client and server programs which are used to transfer an ascii file. Some different information about this project is that the server will wait for client connection and when the client is...


View more questions Search