Derby server connection already exist
In my application I need to check whether the Derby server is already running, and if not start the server. Can开发者_StackOverflow社区 anybody tell me how to check that?
The simplest way I can think of is to retrieve a Derby Connection
. If there's an exception thrown by retrieving the connection, chances are the connection doesn't exist and you can start one.
There is also a 'ping' command available through the NetworkServerControl class: http://db.apache.org/derby/docs/10.8/publishedapi/jdbc4/org/apache/derby/drda/NetworkServerControl.html
精彩评论