• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

is this possible

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i was wondering if its possible to somehow observer and listen to a mysql table for changes of data and then auto update a node from a jtree. i basicly want to remove a node not from say parent node 1, and than move it to parent node 2 automaticly when a item from my MYSQL table has changed...

i been reading on how to create a jtree model for this but trying to avoid it has i have reletivly no experience in customized jtree models and that i kinda need a solution as soon as possible.

cheers
 
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could certainly create a thread that queries your database every now and then and update your graphical user interface accordingly.

If you do so, it is important that you understand well how multithreading works with Swing. Take a look at the API for SwingUtilities.invokeLater().

I hope this helps!
 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This cannot be achieved with JDBC, however, you can fiddle with triggers for reverse notification. I encountered this issue when writing the 'JDBC Adapter for IBM Tivoli Risk Manager'. Your best case is to abstract the busy/wait so that it appears to clients as if they are registering for notification, then write implementations to suit - each with their own trade-offs.
 
Oh. Hi guys! Look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic