Java – how to programmatically launch Apache Derby jar files?

I have a Java application that uses Apache Derby Using the eclipse export option, I export it as a jar file When I run eclipse and the server connects to port 1527, the jar executes correctly

However, when I close eclipse when executing jar (and the server is not connected to 1527), I receive this error

This is understandable But I want to distribute jar So is there a way to programmatically start the server whenever jars are executed?

Solution

You can start networkserver programmatically:

NetworkServerControl serverControl = new NetworkServerControl(InetAddress.getByName("myhost"),1621)

serverControl.shutdown();
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>