Hey guys, Well I had a few questions, so I have an employee Database with id,fname,lname,dep and I wasn't sure if I should do and Employee class whit constructor and what not, and make the class read the information form the Database and then create and ArrayList<employee> and fill it up and have my Table java read from my class with the arraylist or should I just fill up the table directly from the returned queries.
I really dont know to do the last part, but i have done various little projects with Arraylist<Type> and things like that. Do you'll have any suggestions?
pxndx 0
Newbie Poster
Recommended Answers
Jump to PostWell, what I do is:
A class called Employee that represents a single instance of an employee. Probably corresponding to a row from your Employee table. Possible containing related or derived employee data as well. How you expose the properties of your Employee class is a design decision only …
Jump to PostOkay, you're good with supplying a JTable with data, so I'll stick with the db side of things. I presume you're able to get a db connection going. This is very platform-specific and I'd need detailed information to help with that side. Here is the code I would use (using …
All 5 Replies
Paul Norris 0
Newbie Poster
pxndx 0
Newbie Poster
Paul Norris 0
Newbie Poster
pxndx 0
Newbie Poster
Paul Norris 0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.