• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

is this possible  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!