Advertisement

01.30.2008 at 04:03PM PST, ID: 23124905
[x]
Attachment Details

Arrays, Tables, and Databases in NetBeans

Asked by Titanfan21 in NetBeans IDE, MySQL, Java AWT & Swing

Tags: Java

Hi,
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.

Thanks!

MarkStart Free Trial
[+][-]02.05.2008 at 06:50AM PST, ID: 20823282

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: NetBeans IDE, MySQL, Java AWT & Swing
Tags: Java
Sign Up Now!
Solution Provided By: Nellios
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.21.2008 at 02:50AM PDT, ID: 21399875

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628