In addition to Jan's answer, if you do not have a service layer and want to react to any change in the DB, you might want to use a Trigger which is able to execute (PL/)SQL statements. You can use such a statement to write the changes to a file and use a filesystemwatcher to catch changes in the file system. That way, you will alway immediately find out about any DB changes from the Java server.
Then you should use a websocket implementation, which falls back to long-polling AJAX in order to push out changes immediately to your clients.
Software Engineer, Technical Consultant & Mentor