• Post Reply Bookmark Topic Watch Topic
  • New Topic

is this possible  RSS feed

 
jono richy
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
 
Edwin Dalorzo
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!
 
Tony Morris
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!