title: Derby client jdbc driver connection error : Failed to create database 'sample'
body: <p>I started the Derby Network Server like stated in this tutorial - <a href="https://stackoverflow.com/questions/10420902/data-sources-derby-connection-refused/12176840#12176840">here</a>.</p>
  
  <p>But when i typed:</p>
  
  <pre><code>ij&gt;  connect 'jdbc:derby://localhost:1527/sample;create=true',
  </code></pre>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>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</p>
  </blockquote>
  
  <p>Any ideas how to fix this ?</p>
  
  <p><code>derby.log</code> contents:</p>
  
  <pre><code>Tue Oct 13 10:56:03 EEST 2015 : Apache Derby Network Server - 10.11.1.2 - (1629631) started and ready to accept connections on port 1527
  Tue Oct 13 10:56:10 EEST 2015 Thread[DRDAConnThread_2,5,main] Cleanup action starting
  ERROR XBM0H: Directory C:\Program Files\Java\jdk1.8.0_45\db\bin\sample cannot be created.
  at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
  at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
  at org.apache.derby.impl.services.monitor.StorageFactoryService$10.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at org.apache.derby.impl.services.monitor.StorageFactoryService.createServiceRoot(Unknown Source)
  at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
  at org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(Unknown Source)
  at org.apache.derby.impl.services.monitor.FileMonitor.createPersistentService(Unknown Source)
  at org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unknown Source)
  at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source)
  at org.apache.derby.impl.jdbc.EmbedConnection.&lt;init&gt;(Unknown Source)
  at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source)
  at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
  at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
  at org.apache.derby.jdbc.EmbeddedDriver.connect(Unknown Source)
  at org.apache.derby.impl.drda.Database.makeConnection(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.getConnFromDatabaseName(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.verifyUserIdPassword(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.parseSECCHK(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.parseDRDAConnection(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
  Cleanup action completed
  Tue Oct 13 10:56:10 EEST 2015 Thread[DRDAConnThread_2,5,main] Cleanup action starting
  java.sql.SQLException: Failed to create database 'sample', see the next exception for details.
  at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
  at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
  at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
  at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source)
  at org.apache.derby.impl.jdbc.EmbedConnection.&lt;init&gt;(Unknown Source)
  at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source)
  at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
  at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
  at org.apache.derby.jdbc.EmbeddedDriver.connect(Unknown Source)
  at org.apache.derby.impl.drda.Database.makeConnection(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.getConnFromDatabaseName(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.verifyUserIdPassword(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.parseSECCHK(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.parseDRDAConnection(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
  Caused by: ERROR XJ041: Failed to create database 'sample', see the next exception for details.
  at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
  at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
  ... 16 more
  Caused by: ERROR XBM0H: Directory C:\Program Files\Java\jdk1.8.0_45\db\bin\sample cannot be created.
  at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
  at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
  at org.apache.derby.impl.services.monitor.StorageFactoryService$10.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at org.apache.derby.impl.services.monitor.StorageFactoryService.createServiceRoot(Unknown Source)
  at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
  at org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(Unknown Source)
  at org.apache.derby.impl.services.monitor.FileMonitor.createPersistentService(Unknown Source)
  at org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unknown Source)
  ... 13 more
  ============= begin nested exception, level (1) ===========
  java.sql.SQLException: Directory C:\Program Files\Java\jdk1.8.0_45\db\bin\sample cannot be created.
  at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
  at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
  at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
  at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
  at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
  at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source)
  at org.apache.derby.impl.jdbc.EmbedConnection.&lt;init&gt;(Unknown Source)
  at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source)
  at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
  at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
  at org.apache.derby.jdbc.EmbeddedDriver.connect(Unknown Source)
  at org.apache.derby.impl.drda.Database.makeConnection(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.getConnFromDatabaseName(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.verifyUserIdPassword(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.parseSECCHK(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.parseDRDAConnection(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
  Caused by: ERROR XBM0H: Directory C:\Program Files\Java\jdk1.8.0_45\db\bin\sample cannot be created.
  at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
  at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
  at org.apache.derby.impl.services.monitor.StorageFactoryService$10.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at org.apache.derby.impl.services.monitor.StorageFactoryService.createServiceRoot(Unknown Source)
  at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
  at org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(Unknown Source)
  at org.apache.derby.impl.services.monitor.FileMonitor.createPersistentService(Unknown Source)
  at org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unknown Source)
  ... 13 more
  ============= end nested exception, level (1) ===========
  ============= begin nested exception, level (2) ===========
  ERROR XBM0H: Directory C:\Program Files\Java\jdk1.8.0_45\db\bin\sample cannot be created.
  at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
  at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
  at org.apache.derby.impl.services.monitor.StorageFactoryService$10.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at org.apache.derby.impl.services.monitor.StorageFactoryService.createServiceRoot(Unknown Source)
  at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
  at org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(Unknown Source)
  at org.apache.derby.impl.services.monitor.FileMonitor.createPersistentService(Unknown Source)
  at org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unknown Source)
  at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source)
  at org.apache.derby.impl.jdbc.EmbedConnection.&lt;init&gt;(Unknown Source)
  at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source)
  at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
  at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
  at org.apache.derby.jdbc.EmbeddedDriver.connect(Unknown Source)
  at org.apache.derby.impl.drda.Database.makeConnection(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.getConnFromDatabaseName(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.verifyUserIdPassword(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.parseSECCHK(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.parseDRDAConnection(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source)
  at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
  ============= end nested exception, level (2) ===========
  Cleanup action completed
  Tue Oct 13 10:56:10 EEST 2015 Thread[DRDAConnThread_2,5,main] (DATABASE = sample), (DRDAID = {1}), Failed to create database 'sample', see the next exception for details.
  Tue Oct 13 10:56:10 EEST 2015 Thread[DRDAConnThread_2,5,main] (DATABASE = sample), (DRDAID = {1}), Directory C:\Program Files\Java\jdk1.8.0_45\db\bin\sample cannot be created.
  </code></pre>