Java DB. start/stop server in code

I've created a simple JDBC DB app + it works ok if i first right click the (Services-->Database-->Java DB) item, then choose Start Server.
This is ok for debugging purposes, but it doesn't work if i try to run the distributable.