Results 1 to 3 of 3
  1. #1
    hajeer is offline Member
    Join Date
    Jul 2008
    Posts
    1
    Rep Power
    0

    Default Employee Database using an Array

    Hello i need your help on how to create an Employee Database using an array to store the employee’s first name, last name, ID Number, gender, date of birth, address (containing street name, city, state and postal code), employment date, employment status (Probation or Confirmed), designation (job title/position), department, employment type (full-time or part-time) and salary. please its urgent i have tried creating it but i don't have an idea...

  2. #2
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    8

    Default

    Your post has been converted into a thread. Please read the FAQ before posting again - even if your issue is urgent.
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

  3. #3
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    8

    Default

    Make a class that will hold the fields that you want.
    Java Code:
    class Employee {
        String firstName;
        String lastName;
        int IDNumber;
         * gender;         // decide on type, could be a String
         * date of birth;  // could be a Date or String
    
        public Employee(String last, String first, int n, ...) {
            lastName = last;
            firstName = first;
            IDNumber = n;
            ...
        }
    }
    Then make an array of the class type.
    Java Code:
    int size = size_desired
    Employee[] employees = new Employee[size];
    // add an Employee - set the first element of the array:
    employees[0] = new Employee("Hancock", "John", 1522, ...);
    Experiment and discover what works and what doesn't.

Similar Threads

  1. Jsp Project on Employee Details
    By 82rathi.angara in forum JavaServer Pages (JSP) and JSTL
    Replies: 8
    Last Post: 01-20-2014, 09:34 AM
  2. H2 Database Engine 1.0.72
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 05-13-2008, 05:31 PM
  3. Array Reflection: Multi Array Reflection
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-23-2008, 08:08 PM
  4. How to access array stored in database through JSTL
    By saurabh.joshi in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 11-19-2007, 01:46 AM
  5. Database in a PDA
    By percivalwcy in forum JDBC
    Replies: 2
    Last Post: 08-08-2007, 03:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •