Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: To Create and Admin an database

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default To Create and Admin an database

    Hi

    Assignement:

    Im trying to create an database that contains personal information to several clients using an java program. But im stuck and i need help.

    I have created two classes: Database and Client

    - My problems is as followed:

    1 - Creating a method "AddUser", which can register a new "client" to the database.

    2- Creating a method "RemoveUser" which makes it possible to delete a excisting client from the database.

    3- Creating a method"showClientList", which will with the help of System.out.println( ) method, print out a list in the following format:

    Client number______ Name
    --------------------------------------
    00001____________Thomas
    00002____________ Jeff

    It very important that you only print out people that allready excists in the database. and not for the "empty spaces"

    4 - Create a method "printOutOldest", which will print out the oldest client, by the age.


    This is the foundation for the program:

    Class: Client.


    public class Client
    {
    private String name;
    private int clientNumber;
    private int age;

    public Client(String name, int clientNumber, int age)
    {
    this.name = name;
    this.clientNumber = clientnumber;
    this.age = age;
    }

    }


    Class: Database

    import.java.util.Scanner;

    public class Database
    {
    private Scanner input;
    private Client [ ] users;

    public Database( )
    {
    input = newScanner(system.in);
    users = newClient [20]

    }


    public void addUser( )
    {
    }

    public void removeUser( )
    {

    }

    public void showClientList
    {

    }

    public public void printOutOldest( )
    {

    }

    }
    Last edited by JavaNoob89; December 10th, 2010 at 10:02 AM. Reason: Pressed enter to soon:)


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: To Create and Admin an database

    Have you even started this yet? No one is going to complete your assignment for you.
    Please post as much code as you can and tell us where you are stuck.. We can take it from there.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  3. #3
    Junior Member
    Join Date
    Dec 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: To Create and Admin an database

    public void addUser()
    {
    int age;
    int clientNumber;


    System.out.println("Input name: ");
    String name = input.next();
    System.out.println("Input clientnumber: ");
    clientNumber = input.nextInt();
    System.out.println("Input age: ");
    age = input.nextInt();

    new Client(name, clientNumber, age);
    }
    Last edited by JavaNoob89; December 13th, 2010 at 02:07 PM.

Similar Threads

  1. How do i create Sub Form
    By hadhebola in forum Object Oriented Programming
    Replies: 1
    Last Post: July 16th, 2010, 08:21 AM
  2. How to create a database in my cell phone?
    By Viggopiano in forum Java ME (Mobile Edition)
    Replies: 2
    Last Post: July 12th, 2010, 07:26 AM
  3. Replies: 0
    Last Post: April 15th, 2010, 05:13 AM
  4. How to create exe file
    By sirimalla in forum Java Theory & Questions
    Replies: 6
    Last Post: November 1st, 2009, 04:07 AM
  5. how to create exe jar
    By ttsdinesh in forum Java Theory & Questions
    Replies: 1
    Last Post: September 27th, 2009, 08:21 AM