title: Netbeans 7.3.1 Cannot establish a connection to jdbc:derby
body: <p>Recently I'm working on this little project with Java EE and I need to use derby database , but every time I go to service->Database and try to connect to my jdbc:derby I get this error : </p>
  
  <p>Unable to connect. Cannot establish a connection to jdbc:derby://localhost:1527//sample using org.apache.derby.jdbc.ClientDriver (java.netConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.).</p>
  
  <p>and this exception :</p>
  
  <pre><code>Wed Oct 29 15:05:26 EET 2014 : access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve")
  java.security.AccessControlException: access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve")
      at java.security.AccessControlContext.checkPermission(AccessControlContext.java:457)
      at java.security.AccessController.checkPermission(AccessController.java:884)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
      at java.lang.SecurityManager.checkListen(SecurityManager.java:1131)
      at java.net.ServerSocket.bind(ServerSocket.java:374)
      at java.net.ServerSocket.&lt;init&gt;(ServerSocket.java:237)
      at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:231)
      at org.apache.derby.impl.drda.NetworkServerControlImpl.createServerSocket(Unknown Source)
      at org.apache.derby.impl.drda.NetworkServerControlImpl.access$000(Unknown Source)
      at org.apache.derby.impl.drda.NetworkServerControlImpl$1.run(Unknown Source)
      at java.security.AccessControWed Oct 29 15:05:26 EET 2014 : access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve")
  java.security.AccessControlException: access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve")
      at java.security.AccessContrller.doPrivileged(Native Method)
      at org.apache.derby.impl.drda.NetworkServerControlImpl.blockingStart(Unknown Source)
      at org.apache.derby.impl.drda.NetworkServerControlImpl.executeWork(Unknown Source)
      at org.apache.derby.drda.NetworkServerControl.maiolContext.checkPermission(AccessControlContext.java:457)
      at java.security.AccessController.checkPermission(AccessController.java:884)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
      at java.lang.SecurityManager.checkListen(SecurityManager.java:1131)
      at java.net.ServerSocket.bind(ServerSocket.java:374)
      at java.net.ServerSocket.&lt;init&gt;(ServerSocket.java:237)
      at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:231)
      at org.apache.derby.impl.drda.NetworkServerControlImpl.createServerSocket(Unknown Source)
      at org.apache.derby.impl.drda.NetworkServerControlImpl.access$000(Unknown Source)
      at org.apache.derby.impl.drda.NetworkServerControlImpl$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.apache.derby.impl.drda.NetworkServerControlImpl.blockingStart(Unknown Source)
      at org.apache.derby.impl.drda.NetworkServerControlImpl.executeWork(Unknown Source)
      at org.apache.derby.drda.NetworkServerControl.main(Unknown Source)
  n(Unknown Source)
  </code></pre>
  
  <p>Any ideas how to fix it?</p>