Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JDBC and the fly likes change in db to our webapplication Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "change in db to our webapplication" Watch "change in db to our webapplication" New topic
Author

change in db to our webapplication

Pradeep allada
Greenhorn

Joined: Jul 28, 2011
Posts: 17
how to write code for changes occured in the data base to our web application automatically when we open.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26173
    
  66

Pradeep,
Are you asking about how a web page can automatically know when the database changes? If so, you'd have to poll using AJAX or page refreshes.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Pradeep allada
Greenhorn

Joined: Jul 28, 2011
Posts: 17
Thak you for the reply Jeanne Boyarsky

k I will post it in AJAX.
In my project I have an administrator who can modify total db.
and some clients who can modify their own database.

how can a client know that changes done by the administrator without his permission.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26173
    
  66

AJAX wouldn't help with that because the client isn't online. I can think of a few approaches:

1) Have a last modified user/time on each row and show the user a list of changes since last login made by the admin.
2) Set up an e-mail notification when the admin changes things.
3) Manually have the admin tell the client when something has changed.
Pradeep allada
Greenhorn

Joined: Jul 28, 2011
Posts: 17
Jeanne Boyarsky wrote:

1) Have a last modified user/time on each row and show the user a list of changes since last login made by the admin.


k, do we have to use triggers here or else any other option is there?

or
can we get any benefit by using log files?

if yes, how?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26173
    
  66

Pradeep mca wrote:k, do we have to use triggers here or else any other option is there?

YOu can just do a query when the user logs in to see what records have changed. The alternative is to store changes as they happen in a log table, but that's not necessary.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: change in db to our webapplication
 
Similar Threads
Is JavaRanch promoting cheating? (relating to Google Ads)
:mad: Bali Bombing!!!
CONRAD IS STRANGE
four new tin stars
will the whole world unite?