I'm working on a project in NetBeans 6.0 but am having a little difficulty. If anyone is able to help, I'd really appreciate it.
What I'd like to do is display 3 fields in my first java JTable from one MySQL database table. After that, I'd like the user to select a record from the first java JTable. The record they choose has a unique ID number attached. I would like to use that ID number to display data from a second MySQL database table that shares the ID field in a second java JTable.
So if I have in the first JTable:
Jim | Sales | 30
Oscar | Accounting | 40
Toby | HR | 60
I would want someone to select a record, say Jim, whose ID number might be '1'.
Then, in another java JTable, I would like to pull information from another database table about Jim, where there would be 3 or 4 rows with information about Jim, each row containing Jim's ID number: '1.'
2004 | Jim | 30000
2005 | Jim | 40000
2006 | Jim | 50000
2007 | Jim | 70000
I've been told that this can be accomplished using an array to capture the ID number, but I have no idea how to do it.
If anyone would be able to help me out a little, it would be much appreciated.