It seems there's something you aren't telling us. Let's rename your machines A and B, to remove the confusion which the name "localhost" refers to. You have a database server on machine A and then you make a change "from another machine". Probably this means that you run a browser on machine B which connects to Glassfish on machine A, thus updating the database on machine A. Which is a perfectly ordinary thing to do. That much I'm willing to accept as what you meant.
But then you're talking about "hitting return" somewhere to cause those updates to appear somewhere. So what's "somewhere" and what application are you hitting return on?
Always! Wait. Never. Shut up. Look at this tiny ad.