File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Server Sutdown Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Server Sutdown" Watch "Server Sutdown" New topic

Server Sutdown


Joined: Jan 31, 2002
Posts: 2
How do I shut down the server and lock whole databse wih -1?
Travis Zimmerman

Joined: Mar 06, 2002
Posts: 27
I don't believe there is a requirement to have an implementation for the use of locking the entire database. My understanding is that it should only be available int the Data class. As for shut down on the server, I have heard others used ctrl-c, and I plan to do the same.
One alternative is to have the server doing its main duties in a background thread while listening for user input on the command prompt. Having a user type quit could call for whatever shutdown processing is needed before exiting.
Travis Zimmerman
[ March 15, 2002: Message edited by: Travis Zimmerman ]
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Harry, first Javaranch has a naming convention to have your user name be your first and last name.
Secondly, there is a requirement to include the lock(-1) to lock the entire database.
I would suggest creating a simple GUI to start your server, with a button or menuitem that shutsdown the server. In the action of that have the lock(-1) in the code along with close().

Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Server Sutdown
It's not a secret anymore!