title: Derby DB server start by java code
body: <p>I do not want to install a database server on target machine. It is possible that we can simply ship a jar file with the database embedded in it, and not worry about installing a database server separately?
      I created one application in netbeans using derby and it is working fine in my pc but when i am running on other machine it is giving me an Exception<br>
      My code is </p>
  
  <pre><code> System.setProperty("derby.drda.startNetworkServer", "true");
   try {
       NetworkServerControl serverControl = new NetworkServerControl();
       serverControl.start(new PrintWriter(System.out, true));
   } catch (Exception e) {
       e.printStackTrace();
   }
  </code></pre>
  
  <p>For connection i wrote this code  </p>
  
  <pre><code> public static Connection  getderbyConnection() throws     ClassNotFoundException, SQLException    
    {  
          String url = "jdbc:derby://localhost:1527/XLS_Uniquewordlist;create=true";  
        String user = "root";  
        String password = "mantra";  
        Class.forName("org.apache.derby.jdbc.ClientDriver");  
        return (Connection) DriverManager.getConnection(url, user, password);     
  
    }  
  </code></pre>
  
  <p>I am getting this exception      </p>
  
  <blockquote>
  <pre><code>Exception in thread "DRDAConnThread_2" java.lang.NoSuchMethodError:
  </code></pre>
    
    <p>org.apache.derby.iapi.jdbc.EnginePreparedStatement.getVersionCounter()J
          at org.apache.derby.impl.drda.DRDAStatement.prepare(Unknown Source)
          at org.apache.derby.impl.drda.DRDAStatement.explicitPrepare(Unknown
    Source)<br>
        at org.apache.derby.impl.drda.DRDAConnThread.parsePRPSQLSTT(Unknown
    Source)
          at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
    Source)
          at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
        May 12, 2015 5:17:59 PM xls_parser.Main_panel btnokActionPerformed
        SEVERE: null
        java.sql.SQLSyntaxErrorException: DERBY SQL error: SQLCODE: -20001, SQLSTATE: 42X05, SQLERRMC: APP.UNIQUEWORDLIST42X05
          at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown
    Source)
          at org.apache.derby.client.am.SqlException.getSQLException(Unknown
    Source)
          at org.apache.derby.client.am.Connection.prepareStatement(Unknown Source)</p>
  </blockquote>