JTable and AbstractTableModel (with data from multiple access tables)

D

Dinobe

Hey,

I would like to make JTable with an AbstractTableModel, but the information
is stored in multiple Access tables.

A brief description:


I have a table in Access called Docent (docentID, naam, voornaam, straat,
pc, gemeente, telefoon, aantalStageUren)
DocentID is the unique key

I have another table in Access called Stage(stageID, titel, omschrijving,
programmeertaal, database, operatingSystem, softwareOmgeving,
hardwareOmgeving, organisatieID)
stage ID is the unique key

A Third table links those two tabels VoorkeurDocentStage(docentID, stageID,
voorkeur, reden)

docentID & stageID for a combined unique key.

I would like to create a JTable with a AbstractTableModel which shows me the
following:

The columnheaders should contain the naam from Docent
The first column can not be used, because the first colums should contain
all the titels from Stage
on the 'crossroads' of a column and a row should appear de voorkeur (a
value) which is Stored in VoorkeurDocentStage

I would like something like this, (screenshot made in Excel)


http://users.pandora.be/Kalmanados/java/AbstractTableModel.jpg


How can this be done?
I'm really desperate!

Thanks in advance
 
F

Filip Larsen

I would like to make JTable with an AbstractTableModel, but the information
is stored in multiple Access tables.

There are probably many ways to do this, but one that springs to mind is
to get a JDBC driver that gives access to Access tables and supports
joins. Then your application can be done in 50 lines of code (which has
already written for you if you know where to look).

So, to follow this road try search for JDBC driver and Access, and for
JTable and JDBC.


Regards,
 
D

Dinobe

I know how to make a AbstractTableModel and JTable from a single Access
tabel. That works. I only need some one who can explain (detailed) how this
can be done from multiple tables...
Use 1 query to import data from different AccessTables and go through to
resultSet to find the different elements (with for loop) and than put the
correct information in the right place?
Or.....

I just don't know where to start with this...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top