• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need some guidance on how to send messages from a GSM modem on user request.  RSS feed

 
krishna Karthikk
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody, I am Krishna, I am working on a GSM application. The aim of this project is to send messages to mobiles on request. Somewhere a user will be requesting for some details in a specified format say "RESULT ROLL_NUM" for his/her results.

As soon as the message is received the java application will read the message and save a record in the database.

Up to this I have done.

Now the thing is I need to send the reply. All details will be saved in the database. What I want to do is I want to write an entirely new application which continuously looks into the database for any new records. As soon as it finds a new entry it must build the necessary reply and text the sender.

I can write this whole code in the Reader application itself, but due to performance I want to shift it to an entirely another program.

Is this the right way? Or I should code the entire thing in one application.


Thank you all in advance. Have a nice day.
 
Martin Vanyavchich
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm an application that continuously checks the database seems a big performance problem to me. Maybe making it a timed batch job and running it once per half an hour might make more sense. But you'll have to somehow remember, what was the last record you looked up in the database.

If time is an issue, find a way for a database trigger to start your separate program on records inserted into DB.

Regards,

Martin
 
krishna Karthikk
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For this I have to write something like a database listener, can anybody please tell me how to do this?

Thank you all in advance.
 
Martin Vanyavchich
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That depends on your databaes. Chack its documentation
 
krishna Karthikk
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Martin, I am using MySql database. Can you please tell me in some detailed way on how to do this.

Thank you in advance.
 
Martin Vanyavchich
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Krishna,

Info about triggers can be found here. Something about invoking Java is here.

The Java part seems somewhat experimental ...

Have you given any thought of running your program in intervals? 5 minutes or so should suffice. You can set timed executions of your code in Windows or Unix/Linux enviroments.
 
krishna Karthikk
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Martin, thanks for your help from beginning. I have refered the links you have posted. Truly speaking, I did not understand the content there.

I want to try my level best. In the worst case I am thinking to go for a timed batch job.

Anyhow thank you.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!