Dave_P
Dave_P

Reputation: 173

JavaDB wont start on App start, giving me a java.sql.SQLNonTransientConnectionException:

java.sql.SQLNonTransientConnectionException: java.net.ConnectException :
Error connecting to server localhost on port 1527 with message Connection refused: connect.

I am using Netbeans.
If I go to the Services Tab and rightclick Java DB and start Server it works fine.

How can I do this programmaticly at Runtime. I just need whatever method will start the Java DB Server.

Upvotes: 2

Views: 2190

Answers (2)

oers
oers

Reputation: 18714

You need to start the NetworkServerControl additional documentation can be found here

NetworkServerControl server = new NetworkServerControl(InetAddress.getByName("localhost"), port);

Upvotes: 1

tobiasbayer
tobiasbayer

Reputation: 10389

Have a look at how to use JavaDB with a desktop application. They describe how to start it programmatically there.

Upvotes: 2

Related Questions