title: How to embed Apache derby inside a web application
body: <p>I just started developing a web-application. I'd like to use Apache derby as a database packaged inside my web-application.
  Here is the list of jars I am using</p>
  
  <blockquote>
    <p>derby.jar,<br>
    derbyclient.jar,<br>
    derbynet.jar,<br>
    derbytools.jar  </p>
  </blockquote>
  
  <p>I'm unable to establish connection.
  Code snippet is here</p>
  
  <pre><code>//start the server
  NetworkServerControl networkServerControl= new NetworkServerControl(InetAddress.getByName("localhost"),1527);
  networkServerControl.start(null);
  //establish connection &amp; create database
  connection = DriverManager.getConnection("jdbc:derby://localhost:1527/LoginDB;create=true");
  </code></pre>
  
  <p>It's throwing this exception</p>
  
  <pre><code>No suitable driver found for jdbc:derby://localhost:1527/LoginDB;create=true
  </code></pre>
  
  <p>I have placed all the libraries inside the WEB-INF/lib folder of my web application. How to get a connection?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Adding more detail</p>
  
  <pre><code>java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/LoginDB;create=true
  Jan 05, 2013 10:41:23 PM org.apache.catalina.core.StandardWrapperValve invoke
  SEVERE: Servlet.service() for servlet [ReadProperty] in context with path [/Question] threw exception
  java.lang.NullPointerException
      at org.humbledevelopers.question.DerbyDemo.main(DerbyDemo.java:96)
  </code></pre>
  
  <p>code at Line 96: <code>statement=connection.createStatement();</code></p>