This week's giveaway is in the Beginning Java forum.
We're giving away four copies of Bad Programming Practices 101 (e-book) and have Karl Beecher on-line!
See this thread for details.
Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Database Event to update client  RSS feed

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure to write in the correct area because my problem is not properly related with database anyway i will try :-)
I have a mysql database connected to a simulator generating data associated with the behaviour of an electric circuit, I would like to know if it exists the way to "mimic" such electrical circuit in a web page and the possibility to connect a circuit component with a certain parameter in the database that the simulator can change.
For example in the database I have the parameter A1, I am going to build a circuit in a web page and I associate to a certain circuit object the db parameter A1. When the simulator is running a new value of A1 is generated an event is sent to the "mimic"object associated with this parameter and the object changes color or update a label or something similar. Someone can help me with examples or articles to understand at least the technologies to be used.

Thanks
 
author & internet detective
Marshal
Posts: 38367
645
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what forum it belongs in yet either. I put it in a few so we can figure it out once you start getting replies.

I'm not sue what you mean by "mimic". Like a diagram?
 
Sheriff
Posts: 23594
48
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you can have the simulator send a message to the object, that might not be too hard. If you wanted to have a change in the database cause the message to be sent, then that would be a lot harder. But your description doesn't tell me which of those two things you had in mind, or even whether you had something else in mind.
 
takaya treschi
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well currently the simulator generates data to be inserted in the DB. such data are typically par1=2, par2=ON etc. The simulator generates some inserts in the DB and the tables (organized for parameter type: int,double,string ecc.) are 3 columns (parameter_name, date, value).
The improvement could be the association between a certain parameter with an event. It means I can register for a list of parameters (par1,par2, par3) and when one parameter, in the list, changes its value an event is launched and (final step) its representation is modified.
For example if I associate a par1 (with possible values 1 and 0) to a traffic light, and I'm registering for it, every time a new instance of par1 is received a notification is sent and the traffic light representation changes its color.
I imagine I can build the "circuit" using something like a javascript library defining the components and so on, but I have no idea how to connect and notify changes in the database with javascript events.

Thanks    
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!