JTable and AbstractTableModel (with data from multiple access tables)

Discussion in 'Java' started by Dinobe, May 12, 2004.

  1. Dinobe

    Dinobe Guest

    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
    Dinobe, May 12, 2004
    #1
    1. Advertising

  2. Dinobe

    Filip Larsen Guest

    "Dinobe" wrote

    > 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,
    --
    Filip Larsen
    Filip Larsen, May 12, 2004
    #2
    1. Advertising

  3. Dinobe

    Dinobe Guest

    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...
    Dinobe, May 12, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Deshaies
    Replies:
    1
    Views:
    718
    Thomas Weidenfeller
    Apr 21, 2004
  2. Deshaies
    Replies:
    0
    Views:
    456
    Deshaies
    Apr 20, 2004
  3. Edward H. Fabrega
    Replies:
    11
    Views:
    2,946
    Tor Iver Wilhelmsen
    Sep 30, 2004
  4. Replies:
    0
    Views:
    359
  5. Tintin92
    Replies:
    1
    Views:
    1,672
    Andrew Thompson
    Feb 14, 2007
Loading...

Share This Page