title: SQLNonTransientConnectionException - new Connection Profile
body: <p>I want to make a super simple console application that works over a network. I'm using a simple maven project for which I have added the derbyclient dependency(There is no usefull code in the project at this stage). I also have tomcat 8 running. </p>
  
  <p>When I try to get a connection profile thru the data source explorer I get an error. Pictures for clarity:</p>
  
  <p><a href="https://i.stack.imgur.com/x1x6H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x1x6H.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/NZpjJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NZpjJ.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/LBHf4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LBHf4.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/ciV11.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ciV11.png" alt="enter image description here"></a></p>
  
  <p>I've searched for the solution and got a few hits, but they weren't quite helpful. I know the question might be dumb, but I'm new to this stuff, so I have no idea how to fix this. Any help is welcomed!</p>
  
  <p>A detailed error description is below:</p>
  
  <pre><code>java.sql.SQLNonTransientConnectionException: java.net.ConnectException : Error connecting to server localhost on port 1 527 with message Connection refused: connect.
  at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
  at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
  at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
  at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.createConnection(JDBCConnection.java:328)
  at org.eclipse.datatools.connectivity.apache.internal.derby.connection.DerbyEmbeddedJDBCConnection.createConnection(DerbyEmbeddedJDBCConnection.java:137)
  at org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection(DriverConnectionBase.java:105)
  at org.eclipse.datatools.connectivity.DriverConnectionBase.open(DriverConnectionBase.java:54)
  at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.open(JDBCConnection.java:96)
  at org.eclipse.datatools.connectivity.apache.internal.derby.connection.DerbyJDBCConnectionFactory.createConnection(DerbyJDBCConnectionFactory.java:32)
  at org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(ConnectionFactoryProvider.java:83)
  at org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(ConnectionProfile.java:359)
  at org.eclipse.datatools.connectivity.ui.PingJob.createTestConnection(PingJob.java:76)
  at org.eclipse.datatools.connectivity.ui.PingJob.run(PingJob.java:59)
  at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
  Caused by: ERROR 08001: java.net.ConnectException : Error connecting to server localhost on port 1 527 with message Connection refused: connect.
  at org.apache.derby.client.net.NetAgent.&lt;init&gt;(Unknown Source)
  at org.apache.derby.client.net.NetConnection.newAgent_(Unknown Source)
  at org.apache.derby.client.am.ClientConnection.&lt;init&gt;(Unknown Source)
  at org.apache.derby.client.net.NetConnection.&lt;init&gt;(Unknown Source)
  at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl.newNetConnection(Unknown Source)
  ... 12 more
  Caused by: java.net.ConnectException: Connection refused: connect
  at java.net.DualStackPlainSocketImpl.connect0(Native Method)
  at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
  at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
  at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
  at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
  at java.net.PlainSocketImpl.connect(Unknown Source)
  at java.net.SocksSocketImpl.connect(Unknown Source)
  at java.net.Socket.connect(Unknown Source)
  at java.net.Socket.connect(Unknown Source)
  at java.net.Socket.&lt;init&gt;(Unknown Source)
  at java.net.Socket.&lt;init&gt;(Unknown Source)
  at javax.net.DefaultSocketFactory.createSocket(Unknown Source)
  at org.apache.derby.client.net.OpenSocketAction.run(Unknown Source)
  at org.apache.derby.client.net.OpenSocketAction.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  ... 17 more
  </code></pre>
  
  <p>PS: Thanks to Brayan I have started the network server. But know I get the error :</p>
  
  <pre><code>java.sql.SQLNonTransientConnectionException: DERBY SQL error: ERRORCODE: 40000, SQLSTATE: XJ041, SQLERRMC: Failed to create database 'MyDB', see the next exception for details.::SQLSTATE: XBM0H
  at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
  at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
  at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
  at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.createConnection(JDBCConnection.java:328)
  at org.eclipse.datatools.connectivity.apache.internal.derby.connection.DerbyEmbeddedJDBCConnection.createConnection(DerbyEmbeddedJDBCConnection.java:137)
  at org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection(DriverConnectionBase.java:105)
  at org.eclipse.datatools.connectivity.DriverConnectionBase.open(DriverConnectionBase.java:54)
  at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.open(JDBCConnection.java:96)
  at org.eclipse.datatools.connectivity.apache.internal.derby.connection.DerbyJDBCConnectionFactory.createConnection(DerbyJDBCConnectionFactory.java:32)
  at org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(ConnectionFactoryProvider.java:83)
  at org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(ConnectionProfile.java:359)
  at org.eclipse.datatools.connectivity.ui.PingJob.createTestConnection(PingJob.java:76)
  at org.eclipse.datatools.connectivity.ui.PingJob.run(PingJob.java:59)
  at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
  Caused by: ERROR XJ041: DERBY SQL error: ERRORCODE: 40000, SQLSTATE: XJ041, SQLERRMC: Failed to create database 'MyDB', see the next exception for details.::SQLSTATE: XBM0H
  at org.apache.derby.client.am.ClientConnection.completeSqlca(Unknown Source)
  at org.apache.derby.client.net.NetConnectionReply.parseRdbAccessFailed(Unknown Source)
  at org.apache.derby.client.net.NetConnectionReply.parseAccessRdbError(Unknown Source)
  at org.apache.derby.client.net.NetConnectionReply.parseACCRDBreply(Unknown Source)
  at org.apache.derby.client.net.NetConnectionReply.readAccessDatabase(Unknown Source)
  at org.apache.derby.client.net.NetConnection.readSecurityCheckAndAccessRdb(Unknown Source)
  at org.apache.derby.client.net.NetConnection.flowSecurityCheckAndAccessRdb(Unknown Source)
  at org.apache.derby.client.net.NetConnection.flowUSRIDPWDconnect(Unknown Source)
  at org.apache.derby.client.net.NetConnection.flowConnect(Unknown Source)
  at org.apache.derby.client.net.NetConnection.&lt;init&gt;(Unknown Source)
  at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl.newNetConnection(Unknown Source)
  ... 12 more
  </code></pre>
  
  <p>And also when I try to establish a connection thru <code>ij</code> like it was shown in the link in the comment I get the error: <code>ij&gt;  connect 'jdbc:derby://localhost:1527/sample;create=true';
  ERROR XJ041: DERBY SQL error: ERRORCODE: 40000, SQLSTATE: XJ041, SQLERRMC: Faile
  d to create database 'sample', see the next exception for details.::SQLSTATE: XB
  M0H</code>  Any ideas how to fix it ?</p>