Results 1 to 6 of 6
  1. #1
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    6

    Default Embedding an oracle table into a JFrame

    Just curious, is there a way to embed a table from an oracle DB into some frame or component in java? Or would I just create my own table in java and populate it using ResultSet.getWhatever() ?
    Liberty has never come from the government.
    Liberty has always come from the subjects of government.
    The history of liberty is the history of resistance.
    The history of liberty is a history of the limitation of governmental power, not the increase of it.

  2. #2
    markw8500's Avatar
    markw8500 is offline Senior Member
    Join Date
    Jul 2008
    Location
    Pennsylvania, USA
    Posts
    136
    Rep Power
    0

    Default

    What do you mean by "embed"?
    Who Cares... As Long As It Works...

  3. #3
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    6

    Default

    I'd like to be able to take my table directly out of the database and place it in a GUI app developed in Java. So that I can edit values through the app and have them effect the database(I'm already doing this through a text program) and show up immediately in the GUI app.

    Essentially a seamless integration between the table in my app and the table on my DB.

    I know I can do it by manually populating a table made through Java but it would be easier to code/maintain/etc if the GUI table and the DB Tabe were essentially the same item in 2 locations.
    Liberty has never come from the government.
    Liberty has always come from the subjects of government.
    The history of liberty is the history of resistance.
    The history of liberty is a history of the limitation of governmental power, not the increase of it.

  4. #4
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    6

    Default

    i think i understand what you want. i don't know a way to have a "live" representation of the table such that two of your clients can be running and they'd be able to catch each others' updates, though assuming there's only one user connected to the database at a time, i'd just populate my local table and make the changes to it as each query is executed.

    maybe you can find some documentation how mysql admin is written to allow you to do that type of thing?

  5. #5
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    6

    Default

    ya actually populating the local table and querying is what i planned on doing. I just didn't want to have to restart the application or database to view any changes. I guess this means there's no like JFrame.addOracleTable(some SQL retrieve table command) that would give me the table with 1 simple line of code? Would a refresh be enough to update both tables without having to restart the applications?
    Liberty has never come from the government.
    Liberty has always come from the subjects of government.
    The history of liberty is the history of resistance.
    The history of liberty is a history of the limitation of governmental power, not the increase of it.

  6. #6
    markw8500's Avatar
    markw8500 is offline Senior Member
    Join Date
    Jul 2008
    Location
    Pennsylvania, USA
    Posts
    136
    Rep Power
    0

    Default

    I see what you are saying... And as far as I know I don’t think there is API for this... You could design a simple one using threads and an SQL trigger... If you create a second table that has only one cell and the value in that cell changes every time your database table gets updated (the cell will get updated by the trigger) then you could have your application scan the cell for changes... If the value changed your table will repopulate...

    If you are going to do this, then you would probably want to use locks on your table... Because if you are working in the database and you make a change and I am also working in the table and I make a change concurrently then there is a potential that one update will be lost...

    If you only want to update specific cells as each cell gets updated in the database, you would obviously have a more sophisticated trigger and probably a couple more threads...
    Who Cares... As Long As It Works...

Similar Threads

  1. Netbeans 6.5.1 & embedding in html page
    By dbashby in forum New To Java
    Replies: 5
    Last Post: 04-06-2009, 03:58 AM
  2. Embedding Applet into HTML?
    By Unome in forum Java Applets
    Replies: 1
    Last Post: 02-21-2009, 03:40 AM
  3. Replies: 7
    Last Post: 10-06-2008, 04:01 PM
  4. Replies: 0
    Last Post: 08-27-2008, 09:27 AM
  5. Embedding Word in an applet
    By Java Tip in forum SWT
    Replies: 0
    Last Post: 07-25-2008, 02:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •